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 
>blocks
>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
>Organization:
Institut Pasteur
>Environment:
System: NetBSD lynche.sis.pasteur.fr 5.99.55 NetBSD 5.99.55 (LYNCHE) #1: Mon 
Sep 26 13:18:46 CEST 2011 
njoly%lynche.sis.pasteur.fr@localhost:/local/src/NetBSD/obj.amd64/sys/arch/amd64/compile/LYNCHE
 amd64
Architecture: x86_64
Machine: amd64
>Description:
lint(1), in c99 node, do not understand declarations in blocks except at the
beginning.

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:
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 $?
0
njoly@lynche [tmp/lint]> pcc -c declaration.c         
njoly@lynche [tmp/lint]> echo $?             
0

This prevents running lint against some kernel files.
>How-To-Repeat:
Run lint in c99 mode on the previous code sample.
>Fix:



Home | Main Index | Thread Index | Old Index