NetBSD-Bugs archive

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

bin/39639: lint doesn't handle "long double" properly



>Number:         39639
>Category:       bin
>Synopsis:       lint doesn't handle "long double" properly
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Sep 27 19:40:01 +0000 2008
>Originator:     Dave Huang
>Release:        NetBSD 4.99.72
>Organization:
        
>Environment:
        
        
System: NetBSD cheetah.azeotrope.org 4.99.72 NetBSD 4.99.72 (CHEETAH_ACPI) #13: 
Sat Sep 27 03:39:06 CDT 2008 
khym%cheetah.azeotrope.org@localhost:/usr/obj.amd64/sys/arch/amd64/compile/CHEETAH_ACPI
 amd64
Architecture: x86_64
Machine: amd64
>Description:
        It seems like the changes to teach lint about _Complex cause it
to not handle "sizeof(long double)" properly. From what I can tell, the
problem is in lint1/decl.c deftyp(), where a long double gets treated as
long int: t == NOTSPEC, s == NOTSPEC, l == LONG, c == DOUBLE, tp == NULL.
Since t == NOTSPEC, the switch (t) sets t = INT.

A symptom is that building libc (on amd64) fails with:

/usr/src/lib/libc/arch/x86_64/gen/infinityl.c(16): too many array initializers, 
expected 8 [173]

The array is dimensioned as char[sizeof(long double)], which is 16 on amd64,
but lint treats it as char[sizeof(long int)], i.e., 8.

>How-To-Repeat:
        Try to build -current on amd64, or run lint on:

char a[sizeof(long double)] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};

>Fix:
        

>Unformatted:
        
        


Home | Main Index | Thread Index | Old Index