delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2020/11/30/12:44:52

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Recipient: djgpp AT delorie DOT com
To: "DJGPP List (E-mail)" <djgpp AT delorie DOT com>
From: "Andris Pavenis (andris DOT pavenis AT iki DOT fi) [via djgpp AT delorie DOT com]" <djgpp AT delorie DOT com>
Subject: __STRICT_ANSI__ and excluded definitions
Message-ID: <eefd29fe-8e4d-9847-0b63-cc6220304679@iki.fi>
Date: Mon, 30 Nov 2020 19:40:50 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.4.3
MIME-Version: 1.0
X-MIME-Autoconverted: from Quoted-Printable to 8bit by delorie.com id 0AUHfWYt007184
Reply-To: djgpp AT delorie DOT com

Noticed that I'm failing to build recent GIT version of GCC for DJGPP due to different 
interpretation of presence of macro __STRICT_ANSI__=1 in Linux and DJGPP

For example sys/type.h from DJGPP excludes definitions in case of __STRICT_ANSI__ defined. For 
Linux I'm seeing:

Tried versions:  gcc-10.2.0, clang-11.0.0


Presence of __STRICT_ANSI__:

[andris AT ap gcc]$ echo '#include <sys/types.h>' | gcc -dD -E -x c -ansi - | grep STRICT_ANSI
#define __STRICT_ANSI__ 1
[andris AT ap gcc]$ echo '#include <sys/types.h>' | clang -dD -E -x c -ansi - | grep STRICT_ANSI
#define __STRICT_ANSI__ 1


Examples of definitions excluded for DJGPP (tested with clang for C, one is getting the same with GCC)

[andris AT ap gcc]$ echo '#include <sys/types.h>' | clang -dD -E -x c -ansi - | grep dev_t
typedef unsigned long int __dev_t;
typedef __dev_t dev_t;
#define __dev_t_defined
[andris AT ap gcc]$ echo '#include <sys/types.h>' | clang -dD -E -x c -ansi - | grep ino_t
typedef unsigned long int __ino_t;
typedef __ino_t ino_t;
#define __ino_t_defined


One question is of course what is correct behavior according to language standard.

Easiest would be to behave similarly as Linux implementation.

One could also test other implementations (for example from Microsoft).

Current absence of these definitions (dev_t and ino_t as the first) breaks building GCC libcpp (GIT 
trunk from 2020-11-28). I do not known whether  there are other definitions excluded for DJGPP that 
would be required. I can only suspect that more are coming with time.


Andris



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019