NetBSD Problem Report #22500

Received: (qmail 10340 invoked by uid 605); 16 Aug 2003 00:18:04 -0000
Message-Id: <20030816001803.10331.qmail@mail.netbsd.org>
Date: 16 Aug 2003 00:18:03 -0000
From: kristerw@netbsd.org
Sender: gnats-bugs-owner@NetBSD.org
Reply-To: kristerw@netbsd.org
To: gnats-bugs@gnats.netbsd.org
Subject: lint breakage for named initializers
X-Send-Pr-Version: 3.95

>Number:         22500
>Category:       toolchain
>Synopsis:       lint breakage for named initializers
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Aug 16 00:19:00 +0000 2003
>Closed-Date:    
>Last-Modified:  Sun Mar 30 18:45:01 +0000 2008
>Originator:     Krister Walfridsson
>Release:        NetBSD-current as of 2003-08-15
>Organization:

>Environment:


System: NetBSD homeworld.netbsd.org 1.6.1 NetBSD 1.6.1 (HOMEWORLD) #2: Fri Jul 25 09:05:09 CDT 2003 root@aurora.ait.iastate.edu:/usr/NetBSD/kernels/compile/HOMEWORLD i386
Architecture: i386
Machine: i386
>Description:
It is not possible to lint an i386 GENERIC kernel, because lint barfs on
some usages of structure and union named initializers (for example in
dev/ic/icp_ioctl.c).

>How-To-Repeat:
# i386--netbsdelf-lint -S 1.c
1.c(9): undefined struct/union member: a [101]
# i386--netbsdelf-lint -S 2.c
2.c(9): lint error: /usr/local/tmp/nbsd030815/src/tools/lint1/../../usr.bin/xlint/lint1/init.c, 165: popi2()

for the files

--- /dev/null   Fri Aug 15 23:24:11 2003
+++ 1.c Sat Aug 16 02:12:50 2003
@@ -0,0 +1,9 @@
+struct {
+       union {
+               struct {
+                       int a1;
+                       int a2;
+               } a;
+               int b;
+       } c;
+} foo = {{.a = {0, 0}}};

--- /dev/null   Fri Aug 15 23:24:11 2003
+++ 2.c Sat Aug 16 01:54:24 2003
@@ -0,0 +1,9 @@
+struct {
+       union {
+               int a;
+               struct {
+                       int b1;
+                       int b2;
+               } b;
+       } c;
+} bar = {{.b = {0, 0}}};


>Fix:

>Release-Note:
>Audit-Trail:
From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: bin/22500: lint breakage for named initializers
Date: Sun, 30 Mar 2008 18:44:52 +0000

 Not only is this not fixed, it gets even more exciting:

    --- 3.c ---
 struct {
 	struct {
 		int b;
 	} b;
 	struct {
 		int d;
 	} d;
 } bar = {{.b = .d = {0}}};
    --- end ---

 % lint -S 3.c
 3.c:
 lint: /usr/libexec/lint1 got SIGSEGV

 This isn't even syntactically valid; it shouldn't get as far as the
 initializer-handling code, but it does and that's where it dumps
 core.

 I took a look at the initializer-handling code, and it's quite
 resistant to any sort of quick inspection. Maybe it'll make sense if
 really dug through. Maybe I should do that sometime and rework it for
 clarity...

 -- 
 David A. Holland
 dholland@netbsd.org

>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.