This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
-isystem and 'Template with C Linkage'
- From: John Carter <john dot carter at tait dot co dot nz>
- To: ecos-discuss at ecos dot sourceware dot org
- Date: Wed, 05 Dec 2007 15:05:07 +1300 (NZDT)
- Subject: [ECOS] -isystem and 'Template with C Linkage'
I have the answer now, so this is just for the next poor sod who gets
bitten by this fairly unlikely scenario...
So I wanted to extend "kapi.h" under ecos-2.0.
I wrote my .h I wrote my .cxx and pulled in "thread.hxx" to access
a certain C++ only method on threads. (stack_check)
Compiled and gcc spits a warning "Template with C linkage" in clist.hxx
Wah!? After a days worth of Googling and deep forensics of the
preprocessor output (Did you know the...
# LINENUM FILENAME FLAGS
... linemarkers encode the C linkage in the FLAGS field?
Anyhoo, after a days worth of hunting inappropriate 'extern "C" {}'
behaviour I stumble on this brief paragraph in the info docs...
"On very old systems, some of the pre-defined system header
directories get even more special treatment. GNU C++ considers
code in headers found in those directories to be surrounded by an
`extern "C"' block. There is no way to request this behavior with
a `#pragma', or from the command line."
Oh dear, the build system I'm using marks the ecos <cyg/kernel/...>
paths as -isystem. Stop doing that and use -I paths to the ecos stuff
and the problem went away.
Sigh! A wasted day.
John Carter Phone : (64)(3) 358 6639
Tait Electronics Fax : (64)(3) 359 4632
PO Box 1645 Christchurch Email : john.carter@tait.co.nz
New Zealand
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss