[Linux-ha-dev] Re: [Linux-HA] printw warning

Alan Robertson alanr at unix.sh
Thu Aug 11 23:10:14 MDT 2005


Xun SX Sun wrote:
> Hi Alan,
> 
> Thanks & regards
> Sun, Xun
> xunsun at cn.ibm.com
> 
> Alan Robertson <alanr at unix.sh> wrote on 2005-08-11 21:47:11:
> 
>  > Xun SX Sun wrote:
>  > > Hi all,
>  > >
>  > > Since there are several commits after I sent this patch, I have merged
>  > > and rediffed, could someone please review this patch and commit it 
> if OK?
>  >
>  >
>  > You should not perform this check if the current C compiler (which might
>  > not be GCC) supports the -Wcast-qual and -Werror flags, AND if
>  > --disable-fatal-warnings is NOT enabled.
> 
> It is self-contradiction, this check makes sense only if the current
> C compiler supports the -Wcast-qual and -Werror flags. So the
> conclusion is we should do this check in another way? By
> hard-checking the ncurses version(5.3 versus 5.4)?
> 
> I am not sure if I catch your logic. Did you mean avoid double checking
> since this check will be performed in compilation stage in this situation?
> But if compilation fails this check, it will block the compilation, instead
> of configuring itself to skip the ncurses code.

I meant pretty much exactly what I said.

If the compiler supports the flag, then the code is OK like it is.

But, if the compiler doesn't support this flag, then the test for seeing 
if you have a warning isn't going to work, and the result of failure 
doesn't mean anything.  It doesn't mean the compiler will get a warning, 
and it doesn't mean it won't.  It just means that the compiler doesn't 
support those flags.

So, if your compiler doesn't support all the flags, but it does error 
out, then you'll have to put in --suppress-fatal-warnings yourself. 
But, if it doesn't support those flags, the chances are good that it 
doesn't support -Werror.  So, in this case, you'll get warnings, but the 
compilation won't be stopped.  And, this is OK in this case.


>  > There is a function for
>  > testing if various C flags are supported by the current C compiler.
> 
> You must meant cc_supports_flag() ^_^

The very same.  Since I wrote it, naturally, I like it :-)

I wrote it to help us cope with the fact that some flags which we want 
to turn on are only supported by newer versions of GCC.

-- 
     Alan Robertson <alanr at unix.sh>

"Openness is the foundation and preservative of friendship...  Let me 
claim from you at all times your undisguised opinions." - William 
Wilberforce



More information about the Linux-HA-Dev mailing list