Article View: gnu.gcc.help
Article #41522bug in gcc 2.7.2 for HP-UX-9 (HP 9000)
From: Jan Nijtmans
Date: Fri, 15 Mar 1996 00:00
Date: Fri, 15 Mar 1996 00:00
41 lines
1471 bytes
1471 bytes
Why does the following program not do what I expect on HP-UX-9
when compiled with gcc 2.7.2 ? It works fine with gcc on other
machines, and also with cc on the same machine.
It should output:
f1(1.0) = 1.000000
f2(1.0) = 1.000000
But I get:
f1(1.0) = 1.000000
f2(1.0) = 0.000000
The effect only happens when 3 conditions occur together.
The function
- is static
- is called through a function pointer
- has at least a "double" in the argument list
Please, respond by Email, because I normally do not read this
newsgroup.
Jan Nijtmans
NICI (Nijmegen Institute of Cognition and Information)
email: nijtmans@nici.kun.nl
url: http://www.nici.kun.nl/
=================================================================
#include <stdio.h>
static double f1(double value)
{
return value;
}
double (*f2)(double) = f1;
void main(void)
{
printf("f1(1.0) = %f\n",f1(1.0));
printf("f2(1.0) = %f\n",f2(1.0));
}
Technical Details
Message-ID:
<31497DA8.2C20@nici.kun.nl>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,f0ac9f32a033e35f X-Google-Attributes: gid11318c,public From: Jan Nijtmans <nijtmans@nici.kun.nl> Subject: bug in gcc 2.7.2 for HP-UX-9 (HP 9000) Date: 1996/03/15 Message-ID: <31497DA8.2C20@nici.kun.nl> X-Deja-AN: 142926727 content-type: text/plain; charset=us-ascii organization: NICI (Nijmegen Institute of Cognition and Informatics) mime-version: 1.0 newsgroups: gnu.gcc.help x-mailer: Mozilla 2.0 (X11; I; SunOS 5.4 sun4m)