[C2hs] more problems with c2hs
rubenz at cse.unsw.edu.au
Fri Apr 13 17:55:12 EDT 2007
This seems to work on my system:
gcc -E -x c myheader.h
An odd thing I noticed about cpp is that it appears to be a wrapper
for gcc on Darwin:
powerpc-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc.
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
On 13/04/2007, at 12:01 PM, Duncan Coutts wrote:
> On Fri, 2007-04-13 at 11:09 +1000, Ruben Zilibowitz wrote:
>> All these seemed to work except for 2. In the c2hs output it says:
>> cpp -x c ...
>> cpp -x -c ...
>> I think that might be a key issue.
> Doh! That was my mistake. :-) It really should be "-x c" not "-x -c".
> The latter means something totally different :-)
> Sorry, could you try again with my mistake corrected.
> Here's an excerpt from the cpp man page on my system:
> -x c
> -x c++
> -x objective-c
> -x assembler-with-cpp
> Specify the source language: C, C++, Objective-C, or
> assembly. This has nothing to do with standards
> conformance or extensions; it merely selects which
> syntax to expect. If you give none of these options,
> cpp will deduce the language from the extension of the
> source file: .c, .cc, .m, or .S. Some other common
> extensions for C++ and assembly are also
> recognized. If
> cpp does not recognize the extension, it will treat
> file as C; this is the most generic mode.
> I thought this -x c feature was portable, where as relying on cpp to
> default to C mode for a .h file seems much less so. Perhaps we should
> just spit out a .c file instead of a .h file. It wouldn't make much
> difference to c2hs as far as I can see.
More information about the C2hs