Project

General

Profile

« Previous | Next » 

Revision f7e3e5c7

Added by Ken McDonell about 13 years ago

  • ID f7e3e5c78fad76e29d2898f4ce55ed81edd630dc

pmieconf/rules.c - another tricky compiler warning case

Following the example from logutil.c in libpcp, the problem appears to
be the (apparently) bogus attribute((warn_unused_result)) marking
of strtol() and strtoul() in glibc and gcc's inflexibility to over-ride
the attribute marking.

In this case we don't care about the value from strtol() and strtoul()
we're interested in updating the pointer to get past the integer value.

The gross fix that appears to work on all platforms is to declare a
dummy variable to receive the return value, and then mark that variable
as unused using the ugly attribute((unused)) construct.

We were already locked into gcc, but that decision is now set in concrete!

  • added
  • modified
  • copied
  • renamed
  • deleted