codegooglecom / libproxy

Automatically exported from code.google.com/p/libproxy
GNU Lesser General Public License v2.1
0 stars 0 forks source link

NetBSD compilation failure #193

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When building on NetBSD-6.99.20/amd64, the compilation fails with:
[ 52%] Building CXX object 
libproxy/CMakeFiles/libproxy.dir/extension_config.cpp.o
In file included from /usr/include/g++/bits/postypes.h:42:0,
                 from /usr/include/g++/bits/char_traits.h:42,
                 from /usr/include/g++/string:42,
                 from /usr/include/g++/stdexcept:39,
                 from /disk/3/archive/obj/www/libproxy/work.x86_64/libproxy-0.4.11/libproxy/url.hpp:24,
                 from /disk/3/archive/obj/www/libproxy/work.x86_64/libproxy-0.4.11/libproxy/extension_config.hpp:24,
                 from /disk/3/archive/obj/www/libproxy/work.x86_64/libproxy-0.4.11/libproxy/extension_config.cpp:20:
/usr/include/g++/cwchar:166:11: error: '::vfwscanf' has not been declared
/usr/include/g++/cwchar:172:11: error: '::vswscanf' has not been declared
/usr/include/g++/cwchar:176:11: error: '::vwscanf' has not been declared
/usr/include/g++/cwchar:193:11: error: '::wcstof' has not been declared

and

work.x86_64/libproxy-0.4.11/libproxy/test/get-pac-test.cpp: In member function 
‘void TestServer::start()’:
work.x86_64/libproxy-0.4.11/libproxy/test/get-pac-test.cpp:35:41: error: 
‘inet_aton’ was not declared in this scope
work.x86_64/libproxy-0.4.11/libproxy/test/get-pac-test.cpp:36:32: error: 
‘ntohs’ was not declared in this scope

and

work.x86_64/libproxy-0.4.11/libproxy/url.cpp: In function ‘int 
get_default_port(std::string)’:
work.x86_64/libproxy-0.4.11/libproxy/url.cpp:65:28: error: ‘ntohs’ was not 
declared in this scope
work.x86_64/libproxy-0.4.11/libproxy/url.cpp: In member function ‘const 
sockaddr* const* libproxy::url::get_ips(bool)’:
work.x86_64/libproxy-0.4.11/libproxy/url.cpp:337:59: error: ‘htons’ was not 
declared in this scope

and perhaps some more.

The first seems to be related to
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24012
while I don't think the others are defined by posix at all.

For this reason, I recommend removing 
add_definitions(-D_POSIX_C_SOURCE=200112L)
from libproxy/CMakeLists.txt, which fixes the issue (see attached patch against 
0.4.11).

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by tk@giga.or.at on 24 May 2013 at 6:30

Attachments:

GoogleCodeExporter commented 9 years ago
That sounds like the bug is not at ours, but in GCC, who also addressed the 
issue.

We should not workaround other code's issues; their bugs are their bugs.

Original comment by dominiqu...@gmail.com on 26 Aug 2013 at 6:14

GoogleCodeExporter commented 9 years ago
I'm sorry if my bug report was confusing.

Even if the first point might be a gcc bug, the second and third points are not.
The define -D_POSIX_C_SOURCE=200112L claims that the code is only using POSIX 
features of a particular vantage in the code, and it is not. Please remove that 
line.

Thanks.

Original comment by tk@giga.or.at on 26 Aug 2013 at 6:44