This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libgloss/arm/libcfunc.c: alarm [PATCH]


Hi Dave,


(Or the ATTRIBUTE_UNUSED macro
less portable

  Surely the ATTRIBUTE_UNUSED macro masks the gcc-centricness of the
attribute (by wrapping it in #ifdef _GNU_C or somesuch) and should be
considered thoroughly portable?

Well not in this case. Because for a non-GCC compiler ATTRIBUTE_UNUSED
will (presumably) be an empty definition so that the warning message about
an unused parameter could still be generated. Shaun's solution of casting the variable to "(void)" will work for all compilers and does not require the use of a compiler specific feature (ie attributes). Hence it is more portable. A bit strange IMHO, but more portable.


Cheers
  Nick



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]