Re: Strange enum type conversion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Andrew,

> Yes, but there are a fair few loop optimizations that are disabled by
> -fwrapv, so in general it's much better to write in C, not some semi-
> broken version of it.

I heartily agree!  My apologies to everyone if I appeared to be advocating
otherwise.

I would not use -fwrapv, nor do I advocate the use of it to avoid the
surprise.  Rather, I strongly discourage the use of -fwrapv.

Instead of using a -f<something> as a workaround for bad code, I suggest to
the surprised developer to take the opportunity to learn from the surprise,
and (as per Brian Marshall) write in C to avoid such undefined behaviors.

That being said, C has a lot of sharp edges and dusty corners.  Ditto for
C++.  Plenty of opportunities to learn from.

(This is not a slam against C or C++.  Bad code can be written in any
language.)

Sincerely,
--Eljay



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux