Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #2818

Re: what is defined, was for or against equality

From gah4 <gah4@u.washington.edu>
Newsgroups comp.compilers
Subject Re: what is defined, was for or against equality
Date 2022-01-10 16:58 -0800
Organization Compilers Central
Message-ID <22-01-042@comp.compilers> (permalink)
References (1 earlier) <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>

Show all headers | View raw


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().

Back to comp.compilers | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Re: for or against equality, was Why are ambiguous grammars usually a bad idea? Martin Ward <martin@gkc.org.uk> - 2022-01-05 10:25 +0000
  Re: for or against equality, was Why are ambiguous grammars usually a bad idea? David Brown <david.brown@hesbynett.no> - 2022-01-06 09:11 +0100
    Re: what is defined, was for or against equality Thomas Koenig <tkoenig@netcologne.de> - 2022-01-06 16:43 +0000
      Re: what is defined, was for or against equality David Brown <david.brown@hesbynett.no> - 2022-01-07 12:06 +0100
      Re: what is defined, was for or against equality Spiros Bousbouras <spibou@gmail.com> - 2022-01-07 13:21 +0000
        Re: what is defined, was for or against equality Thomas Koenig <tkoenig@netcologne.de> - 2022-01-08 09:31 +0000
          Re: what is defined, was for or against equality Spiros Bousbouras <spibou@gmail.com> - 2022-01-08 22:28 +0000
            Re: what is defined, was for or against equality Thomas Koenig <tkoenig@netcologne.de> - 2022-01-09 00:09 +0000
              Re: what is defined, was for or against equality Spiros Bousbouras <spibou@gmail.com> - 2022-01-09 21:30 +0000
          Re: what is defined, was for or against equality David Brown <david.brown@hesbynett.no> - 2022-01-09 23:00 +0100
            Re: what is defined, was for or against equality Thomas Koenig <tkoenig@netcologne.de> - 2022-01-10 12:04 +0000
              Re: what is defined, was for or against equality David Brown <david.brown@hesbynett.no> - 2022-01-11 18:16 +0100
                Re: what is defined, was for or against equality Kaz Kylheku <480-992-1380@kylheku.com> - 2022-01-11 19:19 +0000
                Re: what is defined, was for or against equality gah4 <gah4@u.washington.edu> - 2022-01-11 14:18 -0800
                Re: what is defined, was for or against equality Thomas Koenig <tkoenig@netcologne.de> - 2022-01-12 19:02 +0000
                Re: what is defined, was for or against equality David Brown <david.brown@hesbynett.no> - 2022-01-13 08:24 +0100
                Re: what is defined, was for or against equality Thomas Koenig <tkoenig@netcologne.de> - 2022-01-13 11:17 +0000
          Re: what is defined, was for or against equality gah4 <gah4@u.washington.edu> - 2022-01-10 16:58 -0800
    Re: for or against equality, was Why are ambiguous grammars usually a bad idea? Robert Prins <robert@prino.org> - 2022-01-06 19:07 +0000
    Undefined behaviour, was: for or against equality Martin Ward <martin@gkc.org.uk> - 2022-01-07 14:02 +0000
      Re: Undefined behaviour, was: for or against equality Spiros Bousbouras <spibou@gmail.com> - 2022-01-08 03:41 +0000
    Re: Undefined behaviour, was: for or against equality David Brown <david.brown@hesbynett.no> - 2022-01-07 15:56 +0100
      Re: Undefined behaviour, was: for or against equality anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2022-01-08 17:52 +0000
        Re: Undefined behaviour, was: for or against equality David Brown <david.brown@hesbynett.no> - 2022-01-09 23:53 +0100
        Re: Undefined behaviour, was: for or against equality Kaz Kylheku <480-992-1380@kylheku.com> - 2022-01-11 16:55 +0000
          Re: Undefined behaviour, was: for or against equality George Neuner <gneuner2@comcast.net> - 2022-01-11 22:01 -0500

csiph-web