Bug 432709 - algorithmfwd.h macro "max" passed 3 arguments, but takes just 2
algorithmfwd.h macro "max" passed 3 arguments, but takes just 2
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
rawhide
All Linux
low Severity low
: ---
: ---
Assigned To: Jakub Jelinek
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-02-13 17:47 EST by Balint Cristian
Modified: 2008-08-02 19:40 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-02-14 09:10:46 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Balint Cristian 2008-02-13 17:47:45 EST
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 03:22:24 EST
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 09:10:46 EST
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.