bug-gnulib
[Top][All Lists]
Advanced

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

Re: minus_zero-related tests fail to compile on ppc with recent gcc


From: Nelson H. F. Beebe
Subject: Re: minus_zero-related tests fail to compile on ppc with recent gcc
Date: Sat, 18 Oct 2008 11:23:52 -0600 (MDT)

Bruno Haible <address@hidden> asks about my problem report of
compiling the expression -LDBL_MIN * LDBL_MIN on Mac OS X PowerPC
systems:

>> ...
>> While Nelson Beebe's report says "Apple Mac OS X 10.x PowerPC", I
>> could not reproduce any problem on MacOS X 10.3.9.)
>> ...

The problem definitely exists, and as I noted, I've seen it in my own
code, and had to work around it.

I have a later O/S release, and newer compilers:

% sw_vers
ProductName:    Mac OS X
ProductVersion: 10.4.11
BuildVersion:   8S165

% system_profiler
Hardware:

    Hardware Overview:

      Machine Name: Power Mac G4
      Machine Model: PowerMac3,6
      CPU Type: PowerPC G4  (3.3)
      Number Of CPUs: 2
      CPU Speed: 1.42 GHz
      L2 Cache (per CPU): 256 KB
      L3 Cache (per CPU): 2 MB
      Memory: 2 GB
      Bus Speed: 167 MHz
      Boot ROM Version: 4.6.0f1
      Serial Number: XXXXXXXXXXXX
...

% uname -a
Darwin XXXX.math.utah.edu 8.11.0 Darwin Kernel Version 8.11.0:
Wed Oct 10 18:26:00 PDT 2007; root:xnu-792.24.17~1/RELEASE_PPC
Power Macintosh powerpc PowerMac3,6 Darwin

% cat foo.c
static long double one = 1.0L * 1.0L;
static long double quarter = 0.5L * 0.5L;
static long double third = 1.0L / 3.0L;
#include <float.h>
long double minus_zero = -LDBL_MIN * LDBL_MIN;

% which cc gcc
/usr/bin/cc
/usr/local/bin/gcc

% cc --version
powerpc-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5367)
...

% cc -c foo.c
foo.c:3: error: initializer element is not constant
foo.c:5: error: initializer element is not constant

% gcc --version
gcc (GCC) 4.3.0 20070817 (experimental)
...

% gcc -c foo.c
foo.c:3: error: initializer element is not constant
foo.c:5: error: initializer element is not constant

-------------------------------------------------------------------------------
- Nelson H. F. Beebe                    Tel: +1 801 581 5254                  -
- University of Utah                    FAX: +1 801 581 4148                  -
- Department of Mathematics, 110 LCB    Internet e-mail: address@hidden  -
- 155 S 1400 E RM 233                       address@hidden  address@hidden -
- Salt Lake City, UT 84112-0090, USA    URL: http://www.math.utah.edu/~beebe/ -
-------------------------------------------------------------------------------




reply via email to

[Prev in Thread] Current Thread [Next in Thread]