First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 9071
Product:  
Component:  
Status: NEW
Resolution:
Assigned To: Not yet assigned to anyone <unassigned@gcc.gnu.org>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: Debian GCC Maintainers <debian-gcc@lists.debian.org>
Add CC:
CC:
Remove selected CCs
Build:
URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 9071 depends on: Show dependency tree
Show dependency graph
Bug 9071 blocks:

Additional Comments:





Mark bug as waiting for feedback
Mark bug as suspended




View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: 2005-12-18 00:36 Opened: 2002-12-27 15:36
[ Reported to the Debian BTS as report #122103.
  Please CC 122103@bugs.debian.org on replies.
  Log of report can be found at http://bugs.debian.org/122103 ]
	

Accidentally leaving the close brace off of a block in e.g., a header
file will often result in errors in files that include it, without any
indication of what is wrong. For example, leaving a namespace open will
usually just give a parse error at the end of the including file.

I'd appreciate it if a warning were issued at the end of a file if there
are still any blocks open.

I realize that leaving a block open through a file ending is not a
violation of the ISO standard's letter or spirit; however, I believe it
is usually a mistake, and one that is otherwise hard to track down. A
compiler warning would make tracking it down much easier, and is
unlikely to give any false alarms.

Release:
3.2.1 (Debian) (Debian unstable)

Environment:
System: Debian GNU/Linux (unstable)
Architecture: i686
host: i386-linux
Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,proto,pascal,objc,ada --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.2 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-java-gc=boehm --enable-objc-gc i386-linux
Thread model: posix
gcc version 3.2.2 20021212 (Debian prerelease)

------- Comment #1 From Dara Hazeghi 2003-05-26 21:49 -------
Hello,

can you provide a small testcase for this problem? And if possible verify that this is still the case in 
gcc 3.3? Thanks,

Dara

------- Comment #2 From Andrew Pinski 2003-05-26 21:52 -------
See Dara's question.

------- Comment #3 From Andrew Pinski 2003-05-28 02:41 -------
Actually is very easy to show:
//header.h
struct A
{
  int i;
//forgot to close the struct.


//file.c
#include "header.h"

int f(struct A *a)
{
   a->i=0;
}

gcc file.c
file.c:4: error: field `f' declared as a function
file.c:4: warning: no semicolon at end of struct or union
file.c:4: error: parse error before '{' token

------- Comment #4 From Dara Hazeghi 2004-01-19 21:05 -------
I'm not sure what the last 4 messages in the PR are, but they're not
particularly useful to us. Could gcc-bugs be taken off the cc: list for them?
Thanks.

------- Comment #5 From Daniel Berlin 2004-01-19 21:08 -------
They are auto-replies from debian's bug system.

I changed the bug reporter so it would stop the mail loop.
I wish the debian guys would stop putting auto-responders as the owners of bugs.
There are quite a few.

If you need to modify a bug that it cc'ed to a @bugs.debian.org address, please
let me know first so i can change who owns it without it sending out email.

------- Comment #6 From Neil Booth 2004-02-04 10:26 -------
Nothing to do with CPP.

First Last Prev Next    No search results available      Search page      Enter new bug