Red Hat Bugzilla – Bug 432709
algorithmfwd.h macro "max" passed 3 arguments, but takes just 2
Last modified: 2008-08-02 19:40:36 EDT
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.
Please have a look at:
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.
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.
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/usr/include/ogdi -I/usr/include/netcdf-3 -I/usr/include/hdf
-I/usr/include/cfitsio -I/usr/include/cfitsio/include -E -dD ogrgeojsonlayer.cpp
-fPIC -DPIC > /tmp/ogrgeojsonlayer.ii
and see what defines max.
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.