Re: what is defined, was for or against equality

gah4 <gah4@u.washington.edu>
Mon, 10 Jan 2022 16:58:55 -0800 (PST)

          From comp.compilers

Related articles
[3 earlier articles]
Re: what is defined, was for or against equality tkoenig@netcologne.de (Thomas Koenig) (2022-01-08)
Re: what is defined, was for or against equality spibou@gmail.com (Spiros Bousbouras) (2022-01-08)
Re: what is defined, was for or against equality tkoenig@netcologne.de (Thomas Koenig) (2022-01-09)
Re: what is defined, was for or against equality spibou@gmail.com (Spiros Bousbouras) (2022-01-09)
Re: what is defined, was for or against equality david.brown@hesbynett.no (David Brown) (2022-01-09)
Re: what is defined, was for or against equality tkoenig@netcologne.de (Thomas Koenig) (2022-01-10)
Re: what is defined, was for or against equality gah4@u.washington.edu (gah4) (2022-01-10)
Re: what is defined, was for or against equality david.brown@hesbynett.no (David Brown) (2022-01-11)
Re: what is defined, was for or against equality 480-992-1380@kylheku.com (Kaz Kylheku) (2022-01-11)
Re: what is defined, was for or against equality gah4@u.washington.edu (gah4) (2022-01-11)
Re: what is defined, was for or against equality tkoenig@netcologne.de (Thomas Koenig) (2022-01-12)
Re: what is defined, was for or against equality david.brown@hesbynett.no (David Brown) (2022-01-13)
Re: what is defined, was for or against equality tkoenig@netcologne.de (Thomas Koenig) (2022-01-13)
| List of all articles for this month |
From: gah4 <gah4@u.washington.edu>
Newsgroups: comp.compilers
Date: Mon, 10 Jan 2022 16:58:55 -0800 (PST)
Organization: Compilers Central
References: <17d70d74-1cf1-cc41-6b38-c0b307aeb35a@gkc.org.uk> 22-01-016 22-01-018 22-01-020 22-01-027 22-01-032
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="20314"; mail-complaints-to="abuse@iecc.com"
Keywords: C, standards
Posted-Date: 10 Jan 2022 21:28:16 EST
In-Reply-To: 22-01-032

On Saturday, January 8, 2022 at 10:11:55 AM UTC-8, Thomas Koenig wrote:


(snip)


> I see C conflating two separate concepts: Programm errors and
> behavior that is outside the standard. "Undefined behavior is
> always a programming error" does not work; that would make


> #include <unistd.h>
> #include <string.h>
> int main()
> {
> char a[] = "Hello, world!\n";
> write (1, a, strlen(a));
> return 0;
> }


Without the:


#include <unistd.h>


I agree that this would be undefined behavior. But with the include file,
you are agreeing to use whatever standard the include file belongs to.


The include file defines the arguments to write(), but even more indicates
that you either supply (in another file), or use an otherwise supplied library
defining write().


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.