Re: [fvwmorg/fvwm] 5b3250: Fix gettext write to read only string; fix warning...

2016-10-26 Thread Florian Schmidt

On 10/25/2016 06:38 PM, Dominik Vogt wrote:

Right.  A solution must disable the warnings on any compilers and
versions the developers use, and not break compilation anywhere.


The way I generally do it is check for the compiler, and then define a 
macro for gcc and for clang using those attributes. Admittedly, that 
works, because for the stuff I work on, those two are all that is 
expected to be ever used; something that probably cannot be said about fvwm.


In the end, this mail (and the one from yesterday) are outdated anyway 
because I see you already found another solution via the 
SUPPRESSED_UNUSED_VAR_WARNING macro, so disregard my comments.


But, since I'm curious: that macro doesn't have the problem of 
potentially masking warnings about using uninitialized variables? I 
guess the important difference is that you only use , not x itself any 
more? Still, that's interesting.



Florian



Re: [fvwmorg/fvwm] 5b3250: Fix gettext write to read only string; fix warning...

2016-10-25 Thread Florian Schmidt

On 10/22/2016 07:35 PM, Dominik Vogt wrote:

And the least invasive way to prevent this is faking a read with
the coid-cast.


I assume marking the variable as potentially unused via 
__attribute__((unused)) or similar is undesirable because it depends on 
compiler-specific extensions? Then again, the warnings are also 
compiler-specific...



Florian