NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/45417: lint(1) in c99 mode do not understand declaration anywhere in block

>Number:         45417
>Category:       bin
>Synopsis:       lint(1) in c99 mode do not understand declarations anywhere in 
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Oct 04 10:00:00 +0000 2011
>Originator:     Nicolas Joly
>Release:        NetBSD 5.99.55
Institut Pasteur
System: NetBSD 5.99.55 NetBSD 5.99.55 (LYNCHE) #1: Mon 
Sep 26 13:18:46 CEST 2011
Architecture: x86_64
Machine: amd64
lint(1), in c99 node, do not understand declarations in blocks except at the

njoly@lynche [tmp/lint]> cat declaration.c 

void sample(void)
  int i = 0; i += 1;
  int j = 0; i += 1;

njoly@lynche [tmp/lint]> lint -S declaration.c 
declaration.c(5): syntax error 'int' [249]

Both gcc and pcc have no problem with this sample code.

njoly@lynche [tmp/lint]> gcc -std=c99 -c declaration.c
njoly@lynche [tmp/lint]> echo $?
njoly@lynche [tmp/lint]> pcc -c declaration.c         
njoly@lynche [tmp/lint]> echo $?             

This prevents running lint against some kernel files.
Run lint in c99 mode on the previous code sample.

Home | Main Index | Thread Index | Old Index