Liste des Groupes | Revenir à c arch |
On 03/09/2024 19:19, Bernd Linsel wrote:Something that might be an error in a 32-bit machine may not beOn 03.09.24 10:10, David Brown wrote:>
>
snip 8< - - - - - - - -
>(There are a few situations where UB in C could be diagnosed at>
compile-time, which are probably historical decisions to avoid
imposing too much work on early compilers. Where possible, UB that
can be caught at compile time, could usefully be turned into constrain
violations that must be diagnosed.)
And exactly these are the situations that I'd like to be warned from,
rather than the compiler making up something without telling.
>
Some of those /are/ warned about by compilers (but I'd rather the
standards said that they were errors). But in general, many can be
handled by good development practice and compiler warnings. Still,
compilers could always get better!
One thing that could make a big difference, I think, is to drop theHow does one call fprintf() under those rules ??
compilation model of each translation unit being compiled to a binary
object independently, with only a minimal amount of information for
linking. Link-time optimisation allows for many extra checks, not all
of which are currently implemented AFAIK. For example, it should be
possible to check that external declarations and definitions match up
correctly across modules - that's currently UB and rarely checked.
Les messages affichés proviennent d'usenet.