Liste des Groupes | Revenir à c arch |
On 31.08.24 11:24, Thomas Koenig wrote: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;
scanf("%d", &i);
return 0;
}
Should this be warned about?
[corrected sscanf -> scanf]
Why? This "program" has the purpose to read one line, presumably
containing an integer number, from stdin and ignore it. No UB anywhere.
Les messages affichés proviennent d'usenet.