Saturday, 23 May 2015

Re: [gccsdk] stdarg.h and stddef.h

In message <55606137.6070403@aaug.net>
John Tytgat <John.Tytgat@aaug.net> wrote:

> On 05/22/2015 07:09 AM, Ron wrote:
> > stdarg.h and stddef.h have references from other files, more-so stddef.h
> > It appears 4.1.2 and 4.7.4 dont have these files, is it ok to delete the
> > #include 's referring to them?
> >
> > It is not an issue I have run into compiling, but Cproto uses the cpp
> > and traces everything in the files.
> >
> > Another thing it errors with is size_t, maybe the cproto grammar.y file
> > needs updating.
>
> stdarg.h and stddef.h. are headers files which should be available for
> building C or C++. Both headers files define very fundamental types
> (like size_t) which are tightly linked to the target definition (in our
> case arm-unknown-riscos). There is no need to delete the include
> statements in C/C++ programs, at some point you need those headers
> either directly or indirectly. Just google/wiki for more info on those
> headers.
>
> Because of their tight link to compiler's target definitions and
> actually being independent of the runtime library, they are located in
> lib/gcc/arm-unknown-riscos/4.7.4/include and not in the runtime library
> (which is in our case UnixLib), not in arm-unknown-riscos/include.
>
> I bet the background of your questions is that you are not using gcc/g++
> frontend executables but rather cpp/cc1 and you're missing all the
> necessary options (like the ones to correctly locate all the include
> directories) which gcc/gcc++ specifiy when starting cpp/cc1/ld/as/ etc.
> Unless you're really really know what you're doing, do not use cpp/cc1
> directly but use gcc/g++ and explore its options like -E/-S/-x etc for
> usecases like 'just preprocess', 'just create assembler file' etc. See
> documentation, or gcc --help
>
> Jo.

Yes to all the above, I was following the linux example of using cpp,
and /did/ find paths were missing and were including them manually.
I missed looking in lib.gcc but will look at using gcc -E (just preprocess) instead, this should save having to specify any paths and make things
simpler/safer.
Cproto uses it's -E switch with 0 to not call gcc/cpp at all /or/ to pass
extra options to cpp, maybe -Wp, <options> will work in that case, when
calling with 'gcc -E -Wp,'
A little confusing, but they are two separate programs and the -E
wont conflict, I think.

Thanks for the help, should be able to make positive progress one way
or another now.

Ron M.

_______________________________________________
GCCSDK mailing list gcc@gccsdk.riscos.info
Bugzilla: http://www.riscos.info/bugzilla/index.cgi
List Info: http://www.riscos.info/mailman/listinfo/gcc
Main Page: http://www.riscos.info/index.php/GCCSDK

No comments:

Post a Comment