NetBSD Problem Report #45666

From njoly@lanfeust.sis.pasteur.fr  Mon Nov 28 08:10:48 2011
Return-Path: <njoly@lanfeust.sis.pasteur.fr>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 4200063D926
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 28 Nov 2011 08:10:48 +0000 (UTC)
Message-Id: <20111128081040.33557DC9BD@lanfeust.sis.pasteur.fr>
Date: Mon, 28 Nov 2011 09:10:40 +0100 (CET)
From: njoly@pasteur.fr
Reply-To: njoly@pasteur.fr
To: gnats-bugs@gnats.NetBSD.org
Subject: lint(1) wrong 'syntax error' message
X-Send-Pr-Version: 3.95

>Number:         45666
>Category:       bin
>Synopsis:       lint(1) wrong 'syntax error' message
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Nov 28 08:15:00 +0000 2011
>Closed-Date:    Mon Dec 26 13:27:40 +0000 2011
>Last-Modified:  Mon Dec 26 13:27:40 +0000 2011
>Originator:     Nicolas Joly
>Release:        NetBSD 5.99.57
>Organization:
Insitut Pasteur
>Environment:
System: NetBSD lanfeust.sis.pasteur.fr 5.99.57 NetBSD 5.99.57 (LANFEUST) #3: Sun Nov 27 10:59:21 CET 2011 njoly@lanfeust.sis.pasteur.fr:/local/src/NetBSD/obj.amd64/sys/arch/amd64/compile/LANFEUST amd64
Architecture: x86_64
Machine: amd64
>Description:
lint(1) generate a wrong 'syntax error' message when a variable declaration,
from a previous typedef,  is used after a statement (C9X mode).

njoly@petaure [~]> cat sample.c 
typedef int int_t;
int main() {
  int i = 0; i+= 1;
  int_t j = 0; j += 1;
  return 0; }
njoly@petaure [~]> lint -Sw sample.c 
sample.c:
sample.c(4): syntax error 'j' [249]
sample.c(4): j undefined [99]

The problem goes away if using some basic type (int) for j.
>How-To-Repeat:
Run lint on previous testcase.
>Fix:

>Release-Note:

>Audit-Trail:
From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/45666: lint(1) wrong 'syntax error' message
Date: Tue, 29 Nov 2011 19:26:41 +0000

 On Mon, Nov 28, 2011 at 08:15:00AM +0000, njoly@pasteur.fr wrote:
  > lint(1) generate a wrong 'syntax error' message when a variable declaration,
  > from a previous typedef,  is used after a statement (C9X mode).

 lint is only sort of c99-compliant.

 -- 
 David A. Holland
 dholland@netbsd.org

From: Nicolas Joly <njoly@pasteur.fr>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/45666: lint(1) wrong 'syntax error' message
Date: Tue, 29 Nov 2011 22:46:37 +0100

 On Tue, Nov 29, 2011 at 07:30:05PM +0000, David Holland wrote:
 > The following reply was made to PR bin/45666; it has been noted by GNATS.
 > 
 > From: David Holland <dholland-bugs@netbsd.org>
 > To: gnats-bugs@NetBSD.org
 > Cc: 
 > Subject: Re: bin/45666: lint(1) wrong 'syntax error' message
 > Date: Tue, 29 Nov 2011 19:26:41 +0000
 > 
 >On Mon, Nov 28, 2011 at 08:15:00AM +0000, njoly@pasteur.fr wrote:
 >> lint(1) generate a wrong 'syntax error' message when a variable declaration,
 >> from a previous typedef,  is used after a statement (C9X mode).
 >  
 >  lint is only sort of c99-compliant.

 Right. Personnally, i would like to have it work just fine to be able
 to run it on kernel code, which includes more and more c99-isms these
 days.

 -- 
 Nicolas Joly

 Projects and Developments in Bioinformatics
 Institut Pasteur, Paris.

From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/45666 CVS commit: src/usr.bin/xlint/lint1
Date: Sat, 24 Dec 2011 20:05:04 -0500

 Module Name:	src
 Committed By:	christos
 Date:		Sun Dec 25 01:05:04 UTC 2011

 Modified Files:
 	src/usr.bin/xlint/lint1: cgram.y

 Log Message:
 PR/45666: Nicolas Joly: lint(1) wrong 'syntax error' message


 To generate a diff of this commit:
 cvs rdiff -u -r1.51 -r1.52 src/usr.bin/xlint/lint1/cgram.y

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->feedback
State-Changed-By: wiz@NetBSD.org
State-Changed-When: Sun, 25 Dec 2011 13:51:28 +0000
State-Changed-Why:
Fixed?


From: Nicolas Joly <njoly@pasteur.fr>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/45666 (lint(1) wrong 'syntax error' message)
Date: Mon, 26 Dec 2011 14:18:35 +0100

 On Sun, Dec 25, 2011 at 01:51:30PM +0000, Thomas Klausner wrote:
 > Synopsis: lint(1) wrong 'syntax error' message
 > 
 > State-Changed-From-To: open->feedback
 > State-Changed-By: wiz@NetBSD.org
 > State-Changed-When: Sun, 25 Dec 2011 13:51:28 +0000
 > State-Changed-Why:
 > Fixed?

 Yes. Thanks.

 -- 
 Nicolas Joly

 Projects and Developments in Bioinformatics
 Institut Pasteur, Paris.

State-Changed-From-To: feedback->closed
State-Changed-By: wiz@NetBSD.org
State-Changed-When: Mon, 26 Dec 2011 13:27:40 +0000
State-Changed-Why:
Confirmed fixed, thanks!


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.