From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4643 invoked by alias); 25 Jun 2013 23:13:30 -0000 Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Received: (qmail 4619 invoked by uid 89); 25 Jun 2013 23:13:27 -0000 X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,RCVD_IN_SORBS_WEB,SPF_PASS autolearn=ham version=3.3.1 Received: from mail-ea0-f173.google.com (HELO mail-ea0-f173.google.com) (209.85.215.173) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 25 Jun 2013 23:13:26 +0000 Received: by mail-ea0-f173.google.com with SMTP id g15so7154548eak.32 for ; Tue, 25 Jun 2013 16:13:24 -0700 (PDT) X-Received: by 10.14.182.132 with SMTP id o4mr1114891eem.94.1372202004063; Tue, 25 Jun 2013 16:13:24 -0700 (PDT) Received: from sg-laptop ([178.123.249.202]) by mx.google.com with ESMTPSA id l42sm39193893eeo.14.2013.06.25.16.13.21 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 25 Jun 2013 16:13:23 -0700 (PDT) Date: Tue, 25 Jun 2013 23:13:00 -0000 From: Sergei Gavrikov To: Grant Edwards cc: eCos Discuss In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [ECOS] Re: Why does #include define a bunch of time-related symbols? X-SW-Source: 2013-06/txt/msg00025.txt.bz2 Hi Grant On Tue, 25 Jun 2013, Grant Edwards wrote: > On 2013-06-25, Grant Edwards wrote: > > > I'm working on a new Ethernet driver. eCos kernel/libs (including the > > new drive) build fine. But, when I try to link an application I get a > > bunch of errors because some time-related functions are defined twice. > > They're defined in libtarget where they're supposed to be, but they're > > also getting defined in the object file for my Ethernet driver [and I > > can't figure out why]. I guess you catch some kind of "Library Issue" http://gcc.gnu.org/c99status.html > It's cause by compiling the driver with the -std=gnu99 flag. I a big > fan of limiting the scope of variables and like to use this sort of > construct: > > for (int i=0; i { > // "i" is only visible inside this block > } > > It appears that eCos header files don't work right when you compile > with C99 semantics... Not only libraries. Many people (me too) are surprised when they look at this table http://en.wikipedia.org/wiki/C99#Implementations -- very few compilers are ready for C99. Of course, if you (your fingers :-) have a habit... Well, you know about C and C++ mix in eCos. If you like for-scope declarations then you would use standard C with a bit of C++ sugar instead C99, eCos way: % grep -Er '\\s+?\(\s+?\' $ECOS_REPOSITORY Though then here and there human can miss the needed extern "C" declarations and that is a penalty for the only one C99 habit. Sergei > -- > Grant Edwards grant.b.edwards Yow! I just forgot my whole > at philosophy of life!!! > gmail.com > > > -- > Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos > and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss > -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss