Bug 432709 - algorithmfwd.h macro "max" passed 3 arguments, but takes just 2
Summary: algorithmfwd.h macro "max" passed 3 arguments, but takes just 2
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: rawhide
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-02-13 22:47 UTC by Balint Cristian
Modified: 2008-08-02 23:40 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2008-02-14 14:10:46 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Balint Cristian 2008-02-13 22:47:45 UTC
Description of problem:
algorithmfwd.h:248:41: error: macro "max" passed 3 arguments, but takes just 2

Version-Release number of selected component (if applicable):
latest gcc-3.4 from koji.

How reproducible:
Please have a look at:
http://koji.fedoraproject.org/koji/getfile?taskID=424414&name=build.log

 Looking to algorithmfwd.h makes me feel like it might be gcc-4.3 fault, 
for some reason i fail to lookup why i get this through header files, however i
am sure i use proper configuration and include correctly this header file. Olso
google-ing around i found no similarities for this strange issue.

Comment 1 Jakub Jelinek 2008-02-14 08:22:24 UTC
Most likely some of the headers you included before <algorithm> defines
#define max(x, y) something
which you of course can't do before including a standard header.
Just run
g++ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic
-fasynchronous-unwind-tables -I. -I.. -I../..
-I/builddir/build/BUILD/gdal-1.5.0-fedora/port
-I/builddir/build/BUILD/gdal-1.5.0-fedora/gcore
-I/builddir/build/BUILD/gdal-1.5.0-fedora/alg
-I/builddir/build/BUILD/gdal-1.5.0-fedora/ogr
-I/builddir/build/BUILD/gdal-1.5.0-fedora/ogr/ogrsf_frmts -DOGR_ENABLED
-I/usr/include/ogdi -I/usr/include/netcdf-3 -I/usr/include/hdf
-I/usr/include/libgeotiff -I/usr/include/libdap
-I/builddir/build/BUILD/gdal-1.5.0-fedora/port -Iexternal/include
-I/usr/include/cfitsio -I/usr/include/cfitsio/include -E -dD ogrgeojsonlayer.cpp
 -fPIC -DPIC > /tmp/ogrgeojsonlayer.ii
and see what defines max.

Comment 2 Balint Cristian 2008-02-14 14:10:46 UTC
Yes, i sorted out.

  Right fix was to move <algorithm> before any header inclusion on top of .c 
file to avoid conflicts. max was defined somewhere probably for other 
platforms, it was defined using #ifdef pragmas at all but order wasnt correct, 
gcc-43 dont pick up <algorithm> anymore by default.


Note You need to log in before you can comment on or make changes to this bug.