Date: Sun, 5 Aug 2007 08:09:40 -0400 (EDT) From: Douglas Wells <sysmaint@contek.com> To: FreeBSD-gnats-submit@FreeBSD.org Cc: sysmaint@contek.com Subject: ports/115217: Ada florist socket program doesn't compile due to internal error Message-ID: <20070805120940.5512439821@mail.contek.com> Resent-Message-ID: <200708051410.l75EA2rv023630@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 115217 >Category: ports >Synopsis: Ada florist socket program doesn't compile due to internal error >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Aug 05 14:10:01 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Douglas Wells >Release: FreeBSD 6.2-RELEASE-p1 i386 >Organization: >Environment: System: FreeBSD flame.contek.com 6.2-RELEASE-p1 FreeBSD 6.2-RELEASE-p1 #0: Sun Feb 11 18:14:07 EST 2007 root@flame.contek.com:/other5/src.6.2/sys/i386/compile/FLAME.6.2 i386 GNAT: gnat-3.15p_1 / gnat-gcc-3.4.6_3 florist: florist-3.15p_1 (tools installed via ports compilation) >Description: A simple Ada program using devel/florist to access POSIX sockets encounters the error: posix-sockets-internet.gpb:660:15: duplication of choice value at line 659 posix-sockets-internet.gpb:674:15: duplication of choice value at line 673 gnatmake: "/usr/local/lib/florist/posix-sockets-internet.adb" compilation error Note that posix-sockets-internet is internal to florist. >How-To-Repeat: Use the command: gnatmake -I/usr/local/lib/florist px_socket.adb with this test program: ------------------------- px_socket.adb ------------------- with POSIX.Sockets; with POSIX.Sockets.Internet; procedure px_socket is package PS renames POSIX.Sockets; package PSI renames POSIX.Sockets.Internet; sockfamily : PS.Protocol_Family := PSI.Internet_Protocol; begin null; end px_socket; ----------------------- end px_socket.adb ----------------- >Fix: The problem seems to arise from a case statement that has duplicate selectors based on the IP type-of-server IPTOS_* values, each of which has the value 0. This problem in turn is caused by a questionable tactic in the internal translation code in c-posix.c, which provides a default value of 0 for any C define that it is unable to locate. The problem here is that the translation process does not have access to the include file <netinet/ip.h>. A workaround is to patch pconfig.h (after make config) to define near the top: #define __BSD_VISIBLE 1 and to include near the other netinet includes: #include <netinet/ip.h> With this change the test program and several other more complicated programs compile and execute properly. This problem may or may not be more cleanly resolved via appropriate changes to the configure mechanism. >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070805120940.5512439821>