You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Doing #include <stddef.h> without any -mcrt args or with -mcrt=libnix
includes /opt/m68k-amigaos/lib/gcc-lib/m68k-amigaos/2.95.4/include/stddef.h
i.e. the gcc-provided header (not the libnix one), which defines whar_t
as unsigned int (see gcc/config/m68k/amigaos.h for WCHAR_TYPE definition.)
However, libnix headers (apparently copied from ixemul) defines it as int,
i.e. signed, in machine/ansi.h.
Because of this, including stddef.h followed by stdlib.h results in an
error: (if the include order is flipped, no errors, though.)
$ /opt/m68k-amigaos/bin/m68k-amigaos-gcc -c 1.c
In file included from /opt/m68k-amigaos/lib/gcc-lib/m68k-amigaos/2.95.4/../../../../m68k-amigaos/sys-include/stdlib.h:40,
from 1.c:2:
/opt/m68k-amigaos/lib/gcc-lib/m68k-amigaos/2.95.4/../../../../m68k-amigaos/sys-include/machine/ansi.h:51: warning: `_BSD_PTRDIFF_T_' redefined
/opt/m68k-amigaos/lib/gcc-lib/m68k-amigaos/2.95.4/include/stddef.h:112: warning: this is the location of the previous definition
/opt/m68k-amigaos/lib/gcc-lib/m68k-amigaos/2.95.4/../../../../m68k-amigaos/sys-include/machine/ansi.h:52: warning: `_BSD_SIZE_T_' redefined
/opt/m68k-amigaos/lib/gcc-lib/m68k-amigaos/2.95.4/include/stddef.h:159: warning: this is the location of the previous definition
In file included from /opt/m68k-amigaos/lib/gcc-lib/m68k-amigaos/2.95.4/../../../../m68k-amigaos/sys-include/stdlib.h:43,
from 1.c:2:
/opt/m68k-amigaos/lib/gcc-lib/m68k-amigaos/2.95.4/../../../../m68k-amigaos/sys-include/sys/types.h:110: warning: redefinition of `size_t'
/opt/m68k-amigaos/lib/gcc-lib/m68k-amigaos/2.95.4/include/stddef.h:170: warning: `size_t' previously declared here
In file included from 1.c:2:
/opt/m68k-amigaos/lib/gcc-lib/m68k-amigaos/2.95.4/../../../../m68k-amigaos/sys-include/stdlib.h:52: conflicting types for `wchar_t'
/opt/m68k-amigaos/lib/gcc-lib/m68k-amigaos/2.95.4/include/stddef.h:255: previous declaration of `wchar_t'
Is there actually a reason why gcc defines whar_t as unsigned int?
The gcc-6 fork of @bebbo seems to define it as unsigned int, too.
However, amigaos4 gcc-4.2 defines it as long int, so does morphos
gcc-4.4 and aros.
I guess machine/ansi.h of libnix (ixemul) needs changing to follow
gcc for this?
The text was updated successfully, but these errors were encountered:
Doing
#include <stddef.h>
without any-mcrt
args or with-mcrt=libnix
includes
/opt/m68k-amigaos/lib/gcc-lib/m68k-amigaos/2.95.4/include/stddef.h
i.e. the gcc-provided header (not the libnix one), which defines
whar_t
as
unsigned int
(see gcc/config/m68k/amigaos.h forWCHAR_TYPE
definition.)However, libnix headers (apparently copied from ixemul) defines it as
int
,i.e.
signed
, inmachine/ansi.h
.Because of this, including
stddef.h
followed bystdlib.h
results in anerror: (if the include order is flipped, no errors, though.)
Is there actually a reason why gcc defines
whar_t
asunsigned int
?The gcc-6 fork of @bebbo seems to define it as
unsigned int
, too.However, amigaos4 gcc-4.2 defines it as
long int
, so does morphosgcc-4.4 and aros.
I guess
machine/ansi.h
of libnix (ixemul) needs changing to followgcc for this?
The text was updated successfully, but these errors were encountered: