Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Improve parsing pmc2c UNUSED arguments #836

Closed
rurban opened this Issue · 3 comments

2 participants

@rurban
Collaborator

Yesterday night I improved pmc2c a lot by checking all the UNUSED macros and
changing them to SHIM the pmc args.

It went from hundreds to zero warnings from clang.

branch rurban/pmc2c-unused-gh836

@rurban rurban was assigned
@rurban rurban referenced this issue from a commit
@rurban rurban [GH #836] Improve parsing pmc2c UNUSED arguments
UNUSED(arg) amcros are now detected in pmc bodies and change the argument declaration
to SHIM().
Empty bodies with return 1; are now detected and the two args are SHIMed.
UNUSED(interp) cause a new warning to be replaced by UNUSED(INTERP).
60cfaca
@leto
Owner

A big +1 to getting rid of all those clang warnings.

@rurban rurban referenced this issue from a commit
@rurban rurban [GH #836] Cleaned wrong UNUSED(arg) macros in all pmc's
Due to an improved pmc2c compiler, which SHIMs all UNUSED args,
a lot of wrong and/or badly placed UNUSED macros have been fixed.
847cb9b
@rurban
Collaborator

Merged with ce2c408

@rurban rurban closed this
@rurban rurban referenced this issue from a commit
@rurban rurban [GH #836] Fix SHIM unused PMC args
The old version did not write the SHIM decl, which caused -Wunused-parameter
warnings with clang.
e86d9b4
@rurban rurban reopened this
@rurban
Collaborator

There were several oversights in the first version of the rurban/pmc2c-unused-gh836 branch.
Only one parameter was shim'ed, several unused parameters got undetected.

rurban/pmc2c-2-gh836 contains an improved pmc2c version, which also:

  • warns on not SHIM'ed parameters, possibly internal unused variables
  • warns on possibly forgotten UNUSED(param) declarations
  • warns on an possible internal recursion error, when the UNUSED decl could not be replaced
  • skips SHIM'ing method bodies with #ifdef
  • detect empty bodies and adds SHIM'ed INTERP and SELF params automatically

Thus several hundred more UNUSED declarations were added to src code.
Work is ongoing for the generated cases default, Null, Proxy.

@rurban rurban referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@rurban rurban referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@rurban rurban referenced this issue from a commit
@rurban rurban [GH #836] Improved pmc2c
support multiple shim'able parameters
warns on not SHIM'ed parameters, possibly internal unused variables
warns on possibly forgotten UNUSED(param) declarations
warns on an possible internal recursion error, when the UNUSED decl could not be replaced
skips SHIM'ing method bodies with #if
detect empty bodies and adds SHIM'ed INTERP and SELF params automatically
af7e332
@rurban rurban referenced this issue from a commit
@rurban rurban [GH #836] pmc2c Sanify parameters beforehand and detect empty bodies
This leaves with a single remaining clang warning for math.ops, and several unrelated
gcc warnings left. null, default and proxy are also detected correctly now.
32ac823
@rurban rurban closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.