Patrice Dumas wrote:
> Hello,
>
> Currently -Wall is added to most of the CFLAGS, and sometimes -ansi
> and -pedantic are added. I think that it is bad, setting CFLAGS
> (except for -I) should be left to the user compiling elektra (or the
> packager) and ./configure. This for 2 reasons:
> * for portability (those flags may break some compilers)
Is elektra currently portable to any other compiler than gcc? Besides,
people who use a different compiler 1) are in the minority, and 2) know
how to turn off -Wall.
Besides, having -Wall there serves a red flag for anyone compiling on a
compiler which doesn't support it -- it means their compiler isn't
explicitly supported and that they should beware.
> * to left the choice to the use compiling elektra.
Why? Warnings are things that should always be fixed or at the very
least done explicitly(*) to avoid confusion about the programmer's intent.
Ignoring warnings is not the right way to fix them.
(*) Like with the warning about using '=' instead of '==' in boolean
expressions.
> For example a
> user may ant to set -Werror but not -Wall
If they're going to set -Werror, they'll have to mess with CFLAGS anyway...
>
> If you agree I can take care of removing the unneeded flags.
Well, I think removing -Wall is a Bad Idea. -Wall is a sensible default
and I would want a much stronger argument than you've given for removing
it. It doesn't prevent code from compiling, and we actually don't WANT
code to compile when -Wall is not supported -- we want the developer
who's trying to compile on an unsupported compiler to actually stop and
try to understand the issues instead of just assuming that things will
work -- warnings be damned. After all, a different compiler may even
issue _different_ warnings which may be valuable to look into. (In fact,
I'd argue that this has already happened with gcc 4.1.1 which
highlighted some places where return values were being ignored).
> If you really want to always use some flags, just add CFLAGS to
> your environemnt, like
> export CFLAGS='-g -O2 -Wall'
Why make the majority of devs add stuff to their environment just to
avoid the minority having to remove those flags? They're already going
to be messing with $CC, anyway.
--
Bardur Arantsson
<[EMAIL PROTECTED]>
- Bite my shiny metal ass.
- It doesn't look so shiny to me.
- Shinier than yours, meatbag.
Bender and Fry / Futurama
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Registry-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/registry-list