This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/24405] New: Trying to compile three size_t's in a struct
- From: "pieter at vodacom dot co dot za" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Oct 2005 06:05:22 -0000
- Subject: [Bug c/24405] New: Trying to compile three size_t's in a struct
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
I get the following error when compile the code below:
main.c:47: warning: declaration does not declare anything
main.c:47: warning: no semicolon at end of struct or union
main.c:47: error: syntax error before numeric constant
main.c:49: error: syntax error before '}' token
main.c: In function `setup_vars':
main.c:89: error: invalid application of `sizeof' to an incomplete type
main.c:91: error: invalid use of undefined type `struct tape_header'
main.c: At top level:
main.c:62: error: storage size of `tape_hdr' isn't known
make: *** [main.o] Error 1
If I uncomment the bottom two size_t's it works. I tried to look into this and
somewhere I found that this is a GCC problem ??? I am not so sure about that,
but can someone please tell me what I am doing wrong ?
struct tape_header
{
char ident [6]; // flows
char label [128]; // Tape Label
char last_bar_code [128]; // last known bar code
size_t bytes_used; // Bytes written to tape
size_t block_size; // Block size at what tape was
format
size_t last_block_used; // Where did we stop
};
gcc -v
Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/specs
Configured with: /var/tmp/portage/gcc-3.3.6/work/gcc-3.3.6/configure
--prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/3.3.6
--includedir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/include
--datadir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3.6
--mandir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3.6/man
--infodir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3.6/info
--with-gxx-include-dir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/include/g++-v3
--host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec
--enable-nls --without-included-gettext --with-system-zlib --disable-checking
--disable-werror --disable-libunwind-exceptions --disable-multilib
--disable-libgcj --enable-languages=c,c++,f77 --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
Thread model: posix
gcc version 3.3.6 (Gentoo 3.3.6, ssp-3.3.6-1.0, pie-8.7.8)
--
Summary: Trying to compile three size_t's in a struct
Product: gcc
Version: 3.3.6
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pieter at vodacom dot co dot za
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24405