Path: csiph.com!weretis.net!feeder6.news.weretis.net!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end From: gah4 Newsgroups: comp.compilers Subject: Re: what is defined, was for or against equality Date: Mon, 10 Jan 2022 16:58:55 -0800 (PST) Organization: Compilers Central Lines: 27 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <22-01-042@comp.compilers> References: <17d70d74-1cf1-cc41-6b38-c0b307aeb35a@gkc.org.uk> <22-01-016@comp.compilers> <22-01-018@comp.compilers> <22-01-020@comp.compilers> <22-01-027@comp.compilers> <22-01-032@comp.compilers> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" 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 X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com In-Reply-To: <22-01-032@comp.compilers> Xref: csiph.com comp.compilers:2818 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 > #include > int main() > { > char a[] = "Hello, world!\n"; > write (1, a, strlen(a)); > return 0; > } Without the: #include 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().