Regarding compiler switches
div0
div0 at users.sourceforge.net
Fri Nov 6 07:28:07 PST 2009
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Nick Sabalausky wrote:
> "div0" <div0 at users.sourceforge.net> wrote in message
> news:hcvnfd$pmq$1 at digitalmars.com...
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Nick Sabalausky wrote:
>>> Sounds like a good time to nag again about the idea of a "treat warnings
>>> as
>>> warnings" option:
>>>
>>> http://d.puremagic.com/issues/show_bug.cgi?id=2567
>>>
>>> A patch is even there that adds "-ww" as an alternative to "-w" that
>>> enables
>>> warnings, but actually treats them as warnings. I *really* hate that DMD
>>> doesn't currently offer an ability to enable warnings without treating
>>> them
>>> as errors, because the current way amounts to nothing more than "optional
>>> errors", which effectively splits D into two different languages (and
>>> those
>>> two languages are a slightly less helpful one, and a somewhat naggy one,
>>> but
>>> the option to treat warnings as warnings would merge them back into the
>>> same
>>> language while maintaining the best of both).
>>>
>>>
>> NO. NO. NO. NO! NO. NO. NO. NO! NO. NO. NO. NO! NO. NO. NO. NO!
>>
>> N N NNN NNN
>> NN N N N NNN
>> N N N N N NNN
>> N NN N N
>> N N NNN N
>>
>> That is an amazingly shit idea.
>> Have you *ever* tried to write portable c++ code???
>>
>> It's utterly impossible without prefixing and postfixing *every* single
>> header filer with the following shit:
>>
>> [more stuff involving how much of a pain warnings can be on C/C++]
>
> Ok, great. Now take the way C/C++ is with warnings right now, as you've
> described, then change it so that *all* C/C++ warnings are *always* treated
> as errors, and tell me how in the world that doesn't make the situation
> *even worse*, let alone somehow better.
I've never come across a single useful C/C++ warning.
They are all either pointless or they are errors.
In my code at work all the warnings that are errors are prompted to
errors and the rest get switched off. And that's a code base started
over 20 years ago, hacked on by hundreds of people and moved though 4
different compilers.
None of our code emits warnings. That way you can actually spot errors
in the compiler output instead of wading though hundreds of lines of
irrelevant garbage.
>
> The only difference would be that if a warning gets through, instead of
> being a mere potential annoyance to the client, you'll have broken their
> whole damn build. Wonderful! How could that possibly be an improvement?
>
It's easy don't have the warnings in the first place.
> Besides, I've been starting to wonder if the *real* problem isn't that
> warning settings always get propogated to libraries (instead of being
> settable on a package-by-package basis. For instance, why shouldn't a
> programmer be able to tell the compiler "I want these warning settings for
> this app I'm compiling, but to hell with any potential warnings in xx and yy
> libraries because that ain't my damn code so don't bug me with it right
> now!"?). I'd think that would fix all those problems with warnings that
> you've described, at least for the most part. Of course, that probably can't
> be fixed in C++ (but then, what *can* be fixed in C++? ;) ), but D actually
> has a module system which should make it possible, at least in theory.
That's a really good idea. Any chance of a patch?
> As far as warnings belonging in a separate lint tool...well, show me a D
> lint tool that, at a minimum, handles the warnings DMD emits, and preferably
> doesn't require the whole f*cking parse process to be repeated, and I'd be
> perfectly happy having all warnings ripped out of my compiler. But there is
> no such D lint tool, in fact, there ain't no D lint tool at all! So until
> that actually gets made, what we have is warnings, and as I've said above,
> having optional non-fatal warnings, bad it it might potentially be, is a
> hell of a lot better than forcing all the warnings to be toggleable errors.
What's wrong with rerunning the whole parse process?
It's not as though it takes long or are you compiling on an iPhone or
something?
One of the c++ apps I work on takes 2:58 seconds just to link and a full
build takes nearly 30 minutes, so the fraction of a second DMD takes
isn't really an issue as far as I'm concerned.
- --
My enormous talent is exceeded only by my outrageous laziness.
http://www.ssTk.co.uk
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iD8DBQFK9ECHT9LetA9XoXwRAgnzAJ4wcW5P4hK8uAzi+3jeo56SpwszrwCg0NJl
acwgR+zlMO3wECxZRS0QTf4=
=YN30
-----END PGP SIGNATURE-----
More information about the Digitalmars-d
mailing list