Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Multiple Includes Causing Multiple Definitions? (GCC 6.3.0) on Debian 9 Date: Fri, 30 Nov 2018 14:56:05 -0800 Organization: None to speak of Lines: 34 Message-ID: References: <0fgrvdluhenh4otagch5r1pe7oprhpkhco@4ax.com> <40avvd9al7gljm349l9tjqv3p544821kmu@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader01.eternal-september.org; posting-host="8de300c505176d684a1af508f676f772"; logging-data="9972"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX188JPEq0REAd/sWYfOeQER7" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:GllGzqSdkAqFwOA+Vut+ytJz4Ds= sha1:r+eh81k0o2tEey+LMwnXeCECb1w= Xref: csiph.com comp.lang.c:138453 Geoff writes: > On Fri, 30 Nov 2018 12:48:19 -0800, Geoff > wrote: > >>If I can produce a simple project that reproduces this result I'll >>post it. >> >>Thanks for all the help. > > I found the error. One of the project headers, invoked by all the > modules had this at the very top: > > #define __attribute__ (x) > > This will probably hose over just about any implementation and I'm > surprised this problem didn't show up a long time ago. It sneaked into > the code somewhere between 2010 and 2013. I blame Obama. :-) I suspect it was actually #define __attribute__(x) without the space. Normally __attribute__ (a common non-standard extension) takes a doubly parenthesized argument, such as __attribute__ ((packed)) The latter macro definition would remove all uses of __attribute__ (which would of course break any code that depends on it). -- Keith Thompson (The_Other_Keith) kst@mib.org Will write code for food. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"