Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GCC 8 compilation issue #10

Closed
chazanov opened this issue Mar 16, 2019 · 3 comments
Closed

GCC 8 compilation issue #10

chazanov opened this issue Mar 16, 2019 · 3 comments

Comments

@chazanov
Copy link

chazanov commented Mar 16, 2019

There is a compilation issue with gcc 8.

Its's similar to kartverket/fyba#21 macro "min" passed 3 arguments, but takes just 2

g++ -march=native -mtune=native -O3 -pipe -fstack-protector-strong -fno-plt -I/usr/include/fyba `pkg-config --cflags lua fyba` -DLINUX -DUNIX -g  -c -o node.o node.cpp
In file included from /usr/include/c++/8.2.1/algorithm:61,
                 from node.cpp:3:
/usr/include/c++/8.2.1/bits/stl_algobase.h:243:56: error: macro "min" passed 3 arguments, but takes just 2
     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
                                                        ^
/usr/include/c++/8.2.1/bits/stl_algobase.h:265:56: error: macro "max" passed 3 arguments, but takes just 2
     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
                                                        ^
In file included from /usr/include/c++/8.2.1/bits/stl_algo.h:60,
                 from /usr/include/c++/8.2.1/algorithm:62,
                 from node.cpp:3:
/usr/include/c++/8.2.1/bits/algorithmfwd.h:375:41: error: macro "max" passed 3 arguments, but takes just 2
     max(const _Tp&, const _Tp&, _Compare);
                                         ^
/usr/include/c++/8.2.1/bits/algorithmfwd.h:388:41: error: macro "min" passed 3 arguments, but takes just 2
     min(const _Tp&, const _Tp&, _Compare);
                                         ^
/usr/include/c++/8.2.1/bits/algorithmfwd.h:416:30: error: macro "min" requires 2 arguments, but only 1 given
     min(initializer_list<_Tp>);
                              ^
/usr/include/c++/8.2.1/bits/algorithmfwd.h:426:30: error: macro "max" requires 2 arguments, but only 1 given
     max(initializer_list<_Tp>);
                              ^
In file included from /usr/include/c++/8.2.1/bits/uniform_int_dist.h:35,
                 from /usr/include/c++/8.2.1/bits/stl_algo.h:66,
                 from /usr/include/c++/8.2.1/algorithm:62,
                 from node.cpp:3:
/usr/include/c++/8.2.1/limits:317:11: error: macro "min" requires 2 arguments, but only 1 given
       min() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
           ^
/usr/include/c++/8.2.1/limits:321:11: error: macro "max" requires 2 arguments, but only 1 given
       max() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
           ^
/usr/include/c++/8.2.1/limits:388:11: error: macro "min" requires 2 arguments, but only 1 given
       min() _GLIBCXX_USE_NOEXCEPT { return false; }
           ^
/usr/include/c++/8.2.1/limits:391:11: error: macro "max" requires 2 arguments, but only 1 given
       max() _GLIBCXX_USE_NOEXCEPT { return true; }
           ^
/usr/include/c++/8.2.1/limits:395:38: error: macro "min" requires 2 arguments, but only 1 given
       lowest() noexcept { return min(); }
                                      ^
/usr/include/c++/8.2.1/limits:457:11: error: macro "min" requires 2 arguments, but only 1 given
       min() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_min(char); }
           ^
/usr/include/c++/8.2.1/limits:460:11: error: macro "max" requires 2 arguments, but only 1 given
       max() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_max(char); }
           ^
/usr/include/c++/8.2.1/limits:464:38: error: macro "min" requires 2 arguments, but only 1 given
       lowest() noexcept { return min(); }
                                      ^
/usr/include/c++/8.2.1/limits:524:11: error: macro "min" requires 2 arguments, but only 1 given
       min() _GLIBCXX_USE_NOEXCEPT { return -__SCHAR_MAX__ - 1; }
           ^
/usr/include/c++/8.2.1/limits:527:11: error: macro "max" requires 2 arguments, but only 1 given
       max() _GLIBCXX_USE_NOEXCEPT { return __SCHAR_MAX__; }
           ^
/usr/include/c++/8.2.1/limits:531:38: error: macro "min" requires 2 arguments, but only 1 given
       lowest() noexcept { return min(); }
                                      ^
/usr/include/c++/8.2.1/limits:594:11: error: macro "min" requires 2 arguments, but only 1 given
       min() _GLIBCXX_USE_NOEXCEPT { return 0; }
           ^
/usr/include/c++/8.2.1/limits:597:11: error: macro "max" requires 2 arguments, but only 1 given
       max() _GLIBCXX_USE_NOEXCEPT { return __SCHAR_MAX__ * 2U + 1; }
           ^
/usr/include/c++/8.2.1/limits:601:38: error: macro "min" requires 2 arguments, but only 1 given
       lowest() noexcept { return min(); }
                                      ^
/usr/include/c++/8.2.1/limits:667:11: error: macro "min" requires 2 arguments, but only 1 given
       min() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_min (wchar_t); }
           ^
/usr/include/c++/8.2.1/limits:670:11: error: macro "max" requires 2 arguments, but only 1 given
       max() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_max (wchar_t); }
           ^
/usr/include/c++/8.2.1/limits:674:38: error: macro "min" requires 2 arguments, but only 1 given
       lowest() noexcept { return min(); }
                                      ^
/usr/include/c++/8.2.1/limits:736:11: error: macro "min" requires 2 arguments, but only 1 given
       min() noexcept { return __glibcxx_min (char16_t); }
           ^
/usr/include/c++/8.2.1/limits:739:11: error: macro "max" requires 2 arguments, but only 1 given
       max() noexcept { return __glibcxx_max (char16_t); }
           ^
/usr/include/c++/8.2.1/limits:742:38: error: macro "min" requires 2 arguments, but only 1 given
       lowest() noexcept { return min(); }
                                      ^
/usr/include/c++/8.2.1/limits:797:11: error: macro "min" requires 2 arguments, but only 1 given
       min() noexcept { return __glibcxx_min (char32_t); }
           ^
/usr/include/c++/8.2.1/limits:800:11: error: macro "max" requires 2 arguments, but only 1 given
       max() noexcept { return __glibcxx_max (char32_t); }
           ^
/usr/include/c++/8.2.1/limits:803:38: error: macro "min" requires 2 arguments, but only 1 given
       lowest() noexcept { return min(); }
                                      ^
/usr/include/c++/8.2.1/limits:859:11: error: macro "min" requires 2 arguments, but only 1 given
       min() _GLIBCXX_USE_NOEXCEPT { return -__SHRT_MAX__ - 1; }
           ^
/usr/include/c++/8.2.1/limits:862:11: error: macro "max" requires 2 arguments, but only 1 given
       max() _GLIBCXX_USE_NOEXCEPT { return __SHRT_MAX__; }
           ^
/usr/include/c++/8.2.1/limits:866:38: error: macro "min" requires 2 arguments, but only 1 given
       lowest() noexcept { return min(); }
                                      ^
/usr/include/c++/8.2.1/limits:926:11: error: macro "min" requires 2 arguments, but only 1 given
       min() _GLIBCXX_USE_NOEXCEPT { return 0; }
           ^
/usr/include/c++/8.2.1/limits:929:11: error: macro "max" requires 2 arguments, but only 1 given
       max() _GLIBCXX_USE_NOEXCEPT { return __SHRT_MAX__ * 2U + 1; }
           ^
/usr/include/c++/8.2.1/limits:933:38: error: macro "min" requires 2 arguments, but only 1 given
       lowest() noexcept { return min(); }
                                      ^
/usr/include/c++/8.2.1/limits:999:11: error: macro "min" requires 2 arguments, but only 1 given
       min() _GLIBCXX_USE_NOEXCEPT { return -__INT_MAX__ - 1; }
           ^
/usr/include/c++/8.2.1/limits:1002:11: error: macro "max" requires 2 arguments, but only 1 given
       max() _GLIBCXX_USE_NOEXCEPT { return __INT_MAX__; }
           ^
/usr/include/c++/8.2.1/limits:1006:38: error: macro "min" requires 2 arguments, but only 1 given
       lowest() noexcept { return min(); }
                                      ^
/usr/include/c++/8.2.1/limits:1066:11: error: macro "min" requires 2 arguments, but only 1 given
       min() _GLIBCXX_USE_NOEXCEPT { return 0; }
           ^
/usr/include/c++/8.2.1/limits:1069:11: error: macro "max" requires 2 arguments, but only 1 given
       max() _GLIBCXX_USE_NOEXCEPT { return __INT_MAX__ * 2U + 1; }
           ^
/usr/include/c++/8.2.1/limits:1073:38: error: macro "min" requires 2 arguments, but only 1 given
       lowest() noexcept { return min(); }
                                      ^
/usr/include/c++/8.2.1/limits:1138:11: error: macro "min" requires 2 arguments, but only 1 given
       min() _GLIBCXX_USE_NOEXCEPT { return -__LONG_MAX__ - 1; }
           ^
/usr/include/c++/8.2.1/limits:1141:11: error: macro "max" requires 2 arguments, but only 1 given
       max() _GLIBCXX_USE_NOEXCEPT { return __LONG_MAX__; }
           ^
/usr/include/c++/8.2.1/limits:1145:38: error: macro "min" requires 2 arguments, but only 1 given
       lowest() noexcept { return min(); }
                                      ^
/usr/include/c++/8.2.1/limits:1205:11: error: macro "min" requires 2 arguments, but only 1 given
       min() _GLIBCXX_USE_NOEXCEPT { return 0; }
           ^
/usr/include/c++/8.2.1/limits:1208:11: error: macro "max" requires 2 arguments, but only 1 given
       max() _GLIBCXX_USE_NOEXCEPT { return __LONG_MAX__ * 2UL + 1; }
           ^
/usr/include/c++/8.2.1/limits:1212:38: error: macro "min" requires 2 arguments, but only 1 given
       lowest() noexcept { return min(); }
                                      ^
/usr/include/c++/8.2.1/limits:1278:11: error: macro "min" requires 2 arguments, but only 1 given
       min() _GLIBCXX_USE_NOEXCEPT { return -__LONG_LONG_MAX__ - 1; }
           ^
/usr/include/c++/8.2.1/limits:1281:11: error: macro "max" requires 2 arguments, but only 1 given
       max() _GLIBCXX_USE_NOEXCEPT { return __LONG_LONG_MAX__; }
           ^
/usr/include/c++/8.2.1/limits:1285:38: error: macro "min" requires 2 arguments, but only 1 given
       lowest() noexcept { return min(); }
                                      ^
/usr/include/c++/8.2.1/limits:1348:11: error: macro "min" requires 2 arguments, but only 1 given
       min() _GLIBCXX_USE_NOEXCEPT { return 0; }
           ^
/usr/include/c++/8.2.1/limits:1351:11: error: macro "max" requires 2 arguments, but only 1 given
       max() _GLIBCXX_USE_NOEXCEPT { return __LONG_LONG_MAX__ * 2ULL + 1; }
           ^
/usr/include/c++/8.2.1/limits:1355:38: error: macro "min" requires 2 arguments, but only 1 given
       lowest() noexcept { return min(); }
                                      ^
/usr/include/c++/8.2.1/limits:1571:85: error: macro "min" requires 2 arguments, but only 1 given
    __INT_N_201103 (__GLIBCXX_TYPE_INT_N_0), __INT_N_U201103 (__GLIBCXX_TYPE_INT_N_0))
                                                                                     ^
/usr/include/c++/8.2.1/limits:1571:85: error: macro "min" requires 2 arguments, but only 1 given
/usr/include/c++/8.2.1/limits:1571:85: error: macro "min" requires 2 arguments, but only 1 given
/usr/include/c++/8.2.1/limits:1571:85: error: macro "max" requires 2 arguments, but only 1 given
/usr/include/c++/8.2.1/limits:1571:85: error: macro "min" requires 2 arguments, but only 1 given
/usr/include/c++/8.2.1/limits:1571:85: error: macro "max" requires 2 arguments, but only 1 given
/usr/include/c++/8.2.1/limits:1599:11: error: macro "min" requires 2 arguments, but only 1 given
       min() _GLIBCXX_USE_NOEXCEPT { return __FLT_MIN__; }
           ^
/usr/include/c++/8.2.1/limits:1602:11: error: macro "max" requires 2 arguments, but only 1 given
       max() _GLIBCXX_USE_NOEXCEPT { return __FLT_MAX__; }
           ^
/usr/include/c++/8.2.1/limits:1674:11: error: macro "min" requires 2 arguments, but only 1 given
       min() _GLIBCXX_USE_NOEXCEPT { return __DBL_MIN__; }
           ^
/usr/include/c++/8.2.1/limits:1677:11: error: macro "max" requires 2 arguments, but only 1 given
       max() _GLIBCXX_USE_NOEXCEPT { return __DBL_MAX__; }
           ^
/usr/include/c++/8.2.1/limits:1749:11: error: macro "min" requires 2 arguments, but only 1 given
       min() _GLIBCXX_USE_NOEXCEPT { return __LDBL_MIN__; }
           ^
/usr/include/c++/8.2.1/limits:1752:11: error: macro "max" requires 2 arguments, but only 1 given
       max() _GLIBCXX_USE_NOEXCEPT { return __LDBL_MAX__; }
           ^
In file included from /usr/include/c++/8.2.1/bits/stl_algo.h:66,
                 from /usr/include/c++/8.2.1/algorithm:62,
                 from node.cpp:3:
/usr/include/c++/8.2.1/bits/uniform_int_dist.h:73:56: error: macro "max" requires 2 arguments, but only 1 given
      _IntType __b = std::numeric_limits<_IntType>::max())
                                                        ^
/usr/include/c++/8.2.1/bits/uniform_int_dist.h:106:57: error: macro "max" requires 2 arguments, but only 1 given
       _IntType __b = std::numeric_limits<_IntType>::max())
                                                         ^
/usr/include/c++/8.2.1/bits/uniform_int_dist.h:150:11: error: macro "min" requires 2 arguments, but only 1 given
       min() const
           ^
/usr/include/c++/8.2.1/bits/uniform_int_dist.h:157:11: error: macro "max" requires 2 arguments, but only 1 given
       max() const
           ^
/usr/include/c++/8.2.1/bits/uniform_int_dist.h:228:40: error: macro "min" requires 2 arguments, but only 1 given
  const __uctype __urngmin = __urng.min();
                                        ^
/usr/include/c++/8.2.1/bits/uniform_int_dist.h:229:40: error: macro "max" requires 2 arguments, but only 1 given
  const __uctype __urngmax = __urng.max();
                                        ^
/usr/include/c++/8.2.1/bits/uniform_int_dist.h:297:40: error: macro "min" requires 2 arguments, but only 1 given
  const __uctype __urngmin = __urng.min();
                                        ^
/usr/include/c++/8.2.1/bits/uniform_int_dist.h:298:40: error: macro "max" requires 2 arguments, but only 1 given
  const __uctype __urngmax = __urng.max();
                                        ^
In file included from /usr/include/c++/8.2.1/algorithm:62,
                 from node.cpp:3:
/usr/include/c++/8.2.1/bits/stl_algo.h:3450:34: error: macro "min" requires 2 arguments, but only 1 given
     min(initializer_list<_Tp> __l)
                                  ^
/usr/include/c++/8.2.1/bits/stl_algo.h:3462:34: error: macro "max" requires 2 arguments, but only 1 given
     max(initializer_list<_Tp> __l)
                                  ^
/usr/include/c++/8.2.1/bits/stl_algo.h:3815:45: error: macro "max" requires 2 arguments, but only 1 given
       const __uc_type __urngrange = __g.max() - __g.min();
                                             ^
/usr/include/c++/8.2.1/bits/stl_algo.h:3815:57: error: macro "min" requires 2 arguments, but only 1 given
       const __uc_type __urngrange = __g.max() - __g.min();
                                                         ^
/usr/include/c++/8.2.1/bits/stl_algo.h:5764:45: error: macro "max" requires 2 arguments, but only 1 given
       const __uc_type __urngrange = __g.max() - __g.min();
                                             ^
/usr/include/c++/8.2.1/bits/stl_algo.h:5764:57: error: macro "min" requires 2 arguments, but only 1 given
       const __uc_type __urngrange = __g.max() - __g.min();
[.....]
make: *** [<builtin>: node.o] Error 1

After changing the intro of node.cpp into

#include <algorithm>
#include <proj_api.h>
#include "sosi2osm.h"

I'm still getting an error:

In file included from /usr/include/fyba/fyba.h:89,
                 from sosi2osm.h:1,
                 from node.cpp:4:
node.cpp: In function 'long int createNode(double, double, short int, FILE*)':
/usr/include/fyba/fyut.h:128:18: error: expected unqualified-id before '(' token
 #define max(a,b) (((a) > (b)) ? (a) : (b))
                  ^
node.cpp:55:19: note: in expansion of macro 'max'
      sizeM = std::max(1024, sizeM*2);
                   ^~~
@chazanov
Copy link
Author

@Gnonthgol Have you found no time yet to investigate this?

@Gnonthgol
Copy link
Owner

That is correct, I have not been able to prioritize this. However if you have a patch it would make it much easier to merge.

@Gnonthgol
Copy link
Owner

This is an issue with fyba itself. Please use my branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants