| www.delorie.com/archives/browse.cgi | search |
| X-Recipient: | archive-cygwin AT delorie DOT com |
| X-SWARE-Spam-Status: | No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_PASS |
| X-Spam-Check-By: | sourceware.org |
| Message-ID: | <49CAC59C.4080306@users.sourceforge.net> |
| Date: | Wed, 25 Mar 2009 19:00:28 -0500 |
| From: | "Yaakov (Cygwin/X)" <yselkowitz AT users DOT sourceforge DOT net> |
| User-Agent: | Thunderbird 2.0.0.21 (Windows/20090302) |
| MIME-Version: | 1.0 |
| To: | cygwin AT cygwin DOT com |
| Subject: | gcc4: extern inline vs. c99 |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Id: | <cygwin.cygwin.com> |
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
| List-Archive: | <http://sourceware.org/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
| Sender: | cygwin-owner AT cygwin DOT com |
| Mail-Followup-To: | cygwin AT cygwin DOT com |
| Delivered-To: | mailing list cygwin AT cygwin DOT com |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Dave,
gcc-4 -std=c99 appears to be treating extern inline functions as if they
were marked dllexport, leading to all sorts of linking problems. STC:
$ cat > test-ntohs1.c <<EOF
#include <netinet/in.h>
extern void foo (uint32_t);
int main(void) {
uint32_t a = 10;
htonl(a);
foo(a);
return 0;
}
EOF
$ cat > test-ntohs2.c <<EOF
#include <netinet/in.h>
void foo(uint32_t i) {
htonl(i);
}
EOF
$ gcc-4 -o test-ntohs.exe test-ntohs1.c test-ntohs2.c
$ gcc-4 -std=c99 -o test-ntohs.exe test-ntohs1.c test-ntohs2.c
/var/tmp/ccUwNnD4.o:test-ntohs2.c:(.text+0x0): multiple definition of
`___ntohl'
/var/tmp/ccise4Pi.o:test-ntohs1.c:(.text+0x0): first defined here
/var/tmp/ccUwNnD4.o:test-ntohs2.c:(.text+0x15): multiple definition of
`___ntohs'
/var/tmp/ccise4Pi.o:test-ntohs1.c:(.text+0x15): first defined here
collect2: ld returned 1 exit status
Yaakov
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEAREIAAYFAknKxZwACgkQpiWmPGlmQSNL+wCgua1JV2lEwh9wCy1IzKztaBjL
uEwAnioFrNpd0IpIKa/MhnMPcNyUgzmQ
=drUK
-----END PGP SIGNATURE-----
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |