Deutsch   English   Français   Italiano  
<vaunhb$vckc$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Thomas Koenig <tkoenig@netcologne.de>
Newsgroups: comp.arch
Subject: Re: Computer architects leaving Intel...
Date: Sat, 31 Aug 2024 09:24:59 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <vaunhb$vckc$1@dont-email.me>
References: <2024Aug30.161204@mips.complang.tuwien.ac.at>
 <memo.20240830164247.19028y@jgd.cix.co.uk> <vasruo$id3b$1@dont-email.me>
 <2024Aug30.195831@mips.complang.tuwien.ac.at> <vat5ap$jthk$2@dont-email.me>
Injection-Date: Sat, 31 Aug 2024 11:25:00 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="d78104b68bd6a6a358e9a21ee9fe1069";
	logging-data="1028748"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18sdxQcxLXjqf+alc5Uzw+pe3gOUWvDgEc="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:O1a52qEsMv144SmVAN1sERLA9Ak=
Bytes: 1675

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.