Re: Re: [Tidy-cvs] tidy/src streamio.c,1.27,1.28
"Arnaud Desitter" <[email protected]>
| Newsgroups | gmane.comp.web.html-tidy.devel |
|---|---|
| Message-ID | <[email protected]> |
In my opinion, there is not point to add more weird macros as it is
much easier to disable the warning related to unused arguments with
a compiler option.
Either we do nothing or we remove the "#pragma"s. I am not keen of
replacing them with something else. Just my opinion.
Regards,
PS: the form I have seen is "#define UNUSED(x) (void)(x)"
----- Original Message -----
From: "Charlie"
Sent: Friday, March 04, 2005 1:04 PM
Subject: Re: [Tidy-dev] Re: [Tidy-cvs] tidy/src streamio.c,1.27,1.28
> The usual approach is a macro (for compiler not supporting the unused
> pragma):
>
> #define UNUSED( v ) v = v
>
> int foo( int bar )
> {
> UNUSED(bar);
> return 3;
> }
>
> This prevents the compiler warning about the unused parameter.
>
> I'm doing this from memory. The following might also work:
>
> #define UNUSED(v) v
>
>
> At 06:05 PM 3/3/2005 +0100, Bjoern Hoehrmann wrote:
>>* Arnaud Desitter wrote:
>> >"#pragma unused(xxx)" which causes flood of warnings with gcc.
>> >Granted, I can filter them out but what a pain.
>>
>>Terry added them (applying a third-party patch, iirc) to actually remove
>>compiler warnings. MSVC++ does not support such a pragma so I've then
>>added a pragma to disable warnings for `#pragma unused(xxx)`. Sounds like
>>we should remove them?
>
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click