Mats Kindahl wrote:
>
> Antony T Curtis wrote:
>> using (void)x to silence unused parameters is not good and can cause
>> warnings by itself with some compilers. (statement has no effect)
>>
>> An option available for most C++ compilers is to omit the argument
>> name... so..
>>
>> int test1(int a, int b __attribute__((unused)), int c)
>> { return a + c; }
>>
>> can be written as:
>>
>> int test2(int a, int, int c)
>> { return a + c; }
>>
>> The drawback... it won't compile in C mode.
Well... it's on the list of things to do to turn everything into C++
files, since the mix of C and C++ is really only making things more
confusing to no real advantage. So maybe we can switch to this once
that's done. (it is certainly less verbose!)
> #ifndef __GNUC__
> #define __attribute__(X)
> #endif
>
> You can get away with using __attribute__ in the GNU way. No need to have
> special macros for the code (well... there will still be a definition of
> __attribute__, but that is quite well-known).
Yup. We've got this going on right now... and I like it because of the
well-known-ness of it.
Monty
_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help : https://help.launchpad.net/ListHelp