This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

-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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]