Article View: gnu.gcc.bug
Article #6245stddef.h in gcc 2.7.1 include path
From: Josh MacDonald
Date: Fri, 22 Dec 1995 00:00
Date: Fri, 22 Dec 1995 00:00
55 lines
2115 bytes
2115 bytes
I think this is a bug. Surely not a big one, but it causes unnecesary warnings. I am running FreeBSD 2.1.0-RELEASE, though I think it is not the cause of the problem. When including <stddef.h>, which I often do via <std.h> provided by libg++, _BSD_SIZE_T_ remains defined after gcclib/MACHINE/2.7.1/stddef.h has been included. It has been typedef'd already however. When later including /usr/include/stdlib.h, which has the segment of code: #ifdef _BSD_SIZE_T_ typedef _BSD_SIZE_T_ size_t; #undef _BSD_SIZE_T_ #endif which immediately follows an #include <machine/ansi.h> line. Since stddef.h in gcc's include path left size_t typedef'd but _BSD_SIZE_T_ still defined, the preprocessor leaves a statement looking like so: typedef size_t; which causes In file included from test.c:2: /usr/include/stdlib.h:42: warning: empty declaration from the C front end and In file included from /usr/local/lib/g++-include/std/cstdlib.h:6, from /usr/local/lib/g++-include/cstdlib:5, from /usr/local/lib/g++-include/std.h:24, from test.cc:1: /usr/include/stdlib.h:42: warning: abstract declarator used as declaration from the C++ front end. This bothers me. The test files I used were: for standard C: #include <stddef.h> #include <stdlib.h> and for C++: #include <std.h> I looked at that stddef.h and it was kind of confusing, I'm not sure what the correct solution is, I'm sorry. If a patch is available, I'd appreciate knowing (or if its fixed in 2.7.2--when I looked at the readme it seemed as if 2.7.2 was only archetecture dependent fixes.) Thank you (for a great compiler!) -josh
Technical Details
Message-ID:
<199512220827.AAA04003@paris.CS.Berkeley.EDU>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 113d02,9ce2fd0f6f7a23d0,start X-Google-Attributes: gid113d02,public From: jmacd@paris.cs.berkeley.edu (Josh MacDonald) Subject: stddef.h in gcc 2.7.1 include path Date: 1995/12/22 Message-ID: <199512220827.AAA04003@paris.CS.Berkeley.EDU> X-Deja-AN: 122686094 distribution: gnu sender: daemon@cis.ohio-state.edu organization: GNUs Not Usenet newsgroups: gnu.gcc.bug