Hi there. Some very simple code generates a warning when compiled on gcc 4.1.2. The code compiles cleanly, when using gcc 3.4.6
The bug involves the use of fmaxf function that is defined in math.h. First, here is the relevant section: I'm attaching the source file along with the output of the compile command with the -v and -save-temps option. Feel free to let me know what more information is required.
Next, this is the command I used to compile this file, along with the results.
matt@s226n11:~$ gcc Lab9.c -Wall -o Lab9 -lm
Lab9.c: In function ‘printResults’:
Lab9.c:115: warning: implicit declaration of function ‘fmaxf’
Lab9.c:115: warning: incompatible implicit declaration of built-in function ‘fmaxf’
On a machine that has the older version of gcc installed, I do not receive this warning.
The code still runs correctly in both cases, however.
Created attachment 13317 [details]
compiler output with the -v flag
Created attachment 13318 [details]
original source file
You need to build with -std=c99 (see the manual page for fmax)