Eric Blake wrote: > On 06/13/2011 03:23 AM, Jim Meyering wrote: >> +++ b/lib/file-set.h >> @@ -6,7 +6,10 @@ >> >> extern void record_file (Hash_table *ht, char const *file, >> struct stat const *stats) >> - __attribute__ ((nonnull (2, 3))); >> +#if defined __GNUC__ && ((__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ >> > 3) >> + __attribute__ ((nonnull (2, 3))) >> +#endif >> +; > > I'm not a fan of in-declaration #ifdefs; can we rewrite this to: > > #if defined __GNUC__ && ((__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || > __GNUC__ > 3) > # define ATTRIBUTE_NONNULL(a) __attribute__ ((nonnull (a))) > #else > # define ATTRIBUTE_NONNULL(a) /* ignored */ > #endif > > extern void record_file (Hash_table *ht, char const *file, > struct stat const *stats) > ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
I feel the same way, but that definition would impinge on the name space of any application that includes file-set.h. IMHO, in this case, name-space cleanliness trumps aesthetics, especially in a header file that will rarely be read by a human.
