Sujet : Re: Computer architects leaving Intel...
De : tkoenig (at) *nospam* netcologne.de (Thomas Koenig)
Groupes : comp.archDate : 31. Aug 2024, 10:24:59
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vaunhb$vckc$1@dont-email.me>
References : 1 2 3 4 5
User-Agent : slrn/1.0.3 (Linux)
Bernd Linsel <
bl1-thispartdoesnotbelonghere@gmx.com> schrieb:
The clang/gcc maintainers' POV violates the first part of Postel's Law:
>
Be liberal in what you accept, and conservative in what you send.
>
Life would be a lot easier if they just provided a -WUB option that
warns and explains *any* construct that the compiler may regard as UB.
Maybe a bit more elaborate:
#include <stdio.h>
int main()
{
int i;
sscanf("%d", &i);
return 0;
}
Should this be warned about?
Or what about
void foo(int *a)
{
*a ++;
}
Two possible cases of undefined behavior here: a could be an
invalid pointer, and the arithmetic operation could overflow.