Re: Re: [Tidy-cvs] tidy/src streamio.c,1.27,1.28

Charlie <[email protected]>
Newsgroups gmane.comp.web.html-tidy.devel
Message-ID <[email protected]>
Not a big deal, but I somewhat disagree.

The UNUSED(x) macro is explicit.  The warning remains to catch other, 
inadvertently dropped parameters.  My preference is usually to just drop 
the formal argument.  But occasionally, you need to keep the parameter to 
maintain the interface.  E.g. typedef'ed function pointer types such as our 
Parsers.

A somewhat academic point, I guess...

Arnaud, you are in the saddle right now, so I defer to your judgement.

At 02:14 PM 3/4/2005 +0000, Arnaud Desitter wrote:
>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
>_______________________________________________
>Tidy-develop mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/tidy-develop


-------------------------------------------------------
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.