Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • sac2c sac2c
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 395
    • Issues 395
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 27
    • Merge requests 27
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Merge requests
  • !46

GCC 8 warning fixes [unsure]

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Hans-Nikolai Viessmann requested to merge hans/sac2c:gcc8-warning-fixes into develop May 10, 2018
  • Overview 11
  • Commits 1
  • Changes 8

GCC 8 was recently released and introduced some new and improved warnings. The SAC code base currently triggers a few of these - specifically -Wcast-function-type and -Wrestict.

The first applies when a function cast is incompatible with the function pointer. We hit into this mainly in the serialise/de-serialise phase when loading functions from SAC tree files. The latter happens because of some unsafe uses of memory, which occurs when we use sprintf in print/print.c.

Most of the warnings have been reasonably resolved but some still remain.

The general problem is that we have some functions which return a function pointer, which may or may not have one argument defined as part of it type. In types/types.h we specify a few function pointer types to encompasses these, but casting from one variant to the other causes the -Wcast-function-type warning to be issued. I don't know how to resolve that effectively - at the moment I have bodged it by using some GCC #pragma to disable to warning at that point. Any suggestions?

Edited May 11, 2018 by Hans-Nikolai Viessmann
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: gcc8-warning-fixes