public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/12188] New: null char array initializer skipped
@ 2003-09-06 3:17 pat at outerreaches dot com
2003-09-06 3:46 ` [Bug c/12188] " pinskia at gcc dot gnu dot org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: pat at outerreaches dot com @ 2003-09-06 3:17 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12188
Summary: null char array initializer skipped
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pat at outerreaches dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: 2.95.3-7
GCC host triplet: windows98
GCC target triplet: m68hc11
char foo[5] = {'\0', ' ', 'a', 'b', 'c'};
The first null initializer ('\0') is skipped, so foo starts at the second entry
(' '). I.e. foo[0] == ' ', foo[1] == 'a', etc. (If there's some standard that
defines this as correct, my apologies, but it seems wrong to me.)
This is the M68HC11/M68HC12 version of gcc, hosted on windows98.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c/12188] null char array initializer skipped
2003-09-06 3:17 [Bug c/12188] New: null char array initializer skipped pat at outerreaches dot com
@ 2003-09-06 3:46 ` pinskia at gcc dot gnu dot org
2003-09-06 5:47 ` pat at outerreaches dot com
2003-09-06 5:59 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-09-06 3:46 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12188
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |WAITING
------- Additional Comments From pinskia at gcc dot gnu dot org 2003-09-06 03:46 -------
Can you try with a newer GCC as 2.95.x is no longer supported?
Also can you give the output of "gcc -v"?
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c/12188] null char array initializer skipped
2003-09-06 3:17 [Bug c/12188] New: null char array initializer skipped pat at outerreaches dot com
2003-09-06 3:46 ` [Bug c/12188] " pinskia at gcc dot gnu dot org
@ 2003-09-06 5:47 ` pat at outerreaches dot com
2003-09-06 5:59 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: pat at outerreaches dot com @ 2003-09-06 5:47 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12188
------- Additional Comments From pat at outerreaches dot com 2003-09-06 05:47 -------
Well it appears this has/had something to do with alignment. For awhile it was
skipping the first initializer constant (didn't have to be a null). Now I've
changed some things, and the problem is gone. I think the array was aligned at
an odd address when the problem was there, now it's even-aligned and I can't
get it back to odd alignment. Maybe a linker problem? Anyway seems unlikely
you'll be able to reproduce this problem.
Also I guess my version is actually 3.0.4 (although see "compiled by..." line
below). Here is -v output:
Reading specs from C:\USR\BIN\..\lib\gcc-lib\m6811-elf\3.0.4\specs
Configured with: ./configure --target=m6811-elf --program-prefix=m6811-elf- --
host=i586-mingw32msvc --build=i686-pc-linux-gnu --enable-languages=c,c++ --
prefix=\usr
Thread model: single
gcc version 3.0.4 m68hc1x-20030430
C:\USR\BIN\..\lib\gcc-lib\m6811-elf\3.0.4\cc1.exe -lang-c -v -I. -iprefix
C:\USR\BIN\..\lib/gcc-lib/m6811-elf\3.0.4\ -D__GNUC__=3 -D__GNUC_MINOR__=0 -
D__GNUC_PATCHLEVEL__=4 -Dmc68hc1x -D__mc68hc1x__ -D__mc68hc1x -
D__CHAR_UNSIGNED__ -D__OPTIMIZE_SIZE__ -D__OPTIMIZE__ -D__STDC_HOSTED__=1 -
Wall -D__HAVE_SHORT_INT__ -D__INT__=16 -D__INT_MAX__=32767 -Dmc6812 -DMC6812 -
Dmc68hc12 -D__HAVE_SHORT_DOUBLE__ serial.c -quiet -dumpbase serial.c -m68hc12 -
mshort -g -Os -Wall -version -fshort-double -o C:\WINDOWS.000\TEMP\ccjDKggb.s
GNU CPP version 3.0.4 m68hc1x-20030430 (cpplib) (MC68HC11/MC68HC12/MC68HCS12)
GNU C version 3.0.4 m68hc1x-20030430 (m6811-elf)
compiled by GNU C version 2.95.3-7 (mingw experimental).
ignoring nonexistent directory "C:/USR/m6811-elf/sys-include"
ignoring nonexistent directory "/usr/include"
ignoring nonexistent directory "/usr/m6811-elf/sys-include"
#include "..." search starts here:
#include <...> search starts here:
.
C:/USR/lib/gcc-lib/m6811-elf/3.0.4/include
C:/USR/m6811-elf/include
/usr/lib/gcc-lib/m6811-elf/3.0.4/include
/usr/m6811-elf/include
End of search list.
C:\USR\BIN\..\lib\gcc-lib\m6811-elf\3.0.4\..\..\..\..\m6811-elf\bin\as.exe -
m68hc12 -mshort -mshort-double -o serial.o C:\WINDOWS.000\TEMP\ccjDKggb.s
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c/12188] null char array initializer skipped
2003-09-06 3:17 [Bug c/12188] New: null char array initializer skipped pat at outerreaches dot com
2003-09-06 3:46 ` [Bug c/12188] " pinskia at gcc dot gnu dot org
2003-09-06 5:47 ` pat at outerreaches dot com
@ 2003-09-06 5:59 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-09-06 5:59 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12188
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |RESOLVED
Resolution| |INVALID
Version|unknown |3.0.4
------- Additional Comments From pinskia at gcc dot gnu dot org 2003-09-06 05:59 -------
as/ld (binutils) problem is causing this, I would update you binutils, if that does not solve the
problem, then file a bug with them but even now you cannot reproduce it so there still might be a
bug in binutils.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-09-06 5:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-06 3:17 [Bug c/12188] New: null char array initializer skipped pat at outerreaches dot com
2003-09-06 3:46 ` [Bug c/12188] " pinskia at gcc dot gnu dot org
2003-09-06 5:47 ` pat at outerreaches dot com
2003-09-06 5:59 ` pinskia at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).