Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 23 Oct 2018, 09:45
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
GCC hiding standard C header files
Post new topic   Reply to topic View previous topic :: View next topic
Page 3 of 3 [35 Posts]   Goto page: Previous 1, 2, 3
Author Message
jafadmin

Joined: 19 Mar 2009
Posts: 854

PostPosted: Sun 20 May 2018, 08:58    Post subject:  

C was designed to be a portable language, and as such, C compilers can be found for most architectures and Operating systems.

Examples of things that are system dependent are endianess, bytesize, integer size, and pointer size.

So while the contents of <stdio.h> will likely be the same across platforms and architectures, the content of those header files that define the hardware to the compiler will always vary.
Back to top
View user's profile Send private message 
WIckedWitch

Joined: 29 Mar 2018
Posts: 221
Location: West Wales bandit country

PostPosted: Sun 20 May 2018, 15:59    Post subject:  

jafadmin wrote:
C was designed to be a portable language, and as such, C compilers can be found for most architectures and Operating systems.

Examples of things that are system dependent are endianess, bytesize, integer size, and pointer size.

So while the contents of <stdio.h> will likely be the same across platforms and architectures, the content of those header files that define the hardware to the compiler will always vary.


AFAI can see, after rummaging around more sets of header files than I care to recall over the years, architecture-specific adaptation of headers is readily, if not always entirely straightforwardly, effected by defining a (sometimes large) number of scalar parameters as macros and then conditionally compiling headers as chunks of code that are conditionally included according to the values of those parameters.

It is technically possible to do this without having to separate any standard headers from the compiler install package, as is routine practice in all commercially supported compilers that I have looked into. Indeed the typical practice for commercial, multi-targettable embedded C compilers, is to give a complete set of architecture-dependent standard headers for each supported target architecture - and often for different chip variants within a single architecture.

Given that there is no technical necessity for separation of standard headers from the rest of the compiler, I am at a loss to see why gcc seems to think it a good thing to do - unless as far as gcc is concerned, POSIX is the only platform they are concerned with. This, of course, makes it far harder than necessary to create verifiably repeatable installed compiler configurations, the absence of which is utter anathema in the development of critical systems.

_________________
Sometimes I post mindfully, sometimes not mindfully, and sometimes both mindfully and not mindfully. It all depends on whether and when my mind goes walkies while I'm posting Confused
Back to top
View user's profile Send private message 
jafadmin

Joined: 19 Mar 2009
Posts: 854

PostPosted: Mon 21 May 2018, 12:01    Post subject:  

Run these two commands from a console to produce all the info about the linux gcc compiler environment:
Code:
#touch a.c
#gcc -v -E a.c
Back to top
View user's profile Send private message 
s243a

Joined: 02 Sep 2014
Posts: 1228

PostPosted: Mon 21 May 2018, 13:43    Post subject:  

Some symbolic links might help like I did here:
http://murga-linux.com/puppy/viewtopic.php?p=992688#992688
Back to top
View user's profile Send private message 
WIckedWitch

Joined: 29 Mar 2018
Posts: 221
Location: West Wales bandit country

PostPosted: Tue 22 May 2018, 13:24    Post subject:  

jafadmin wrote:
Run these two commands from a console to produce all the info about the linux gcc compiler environment:
Code:
#touch a.c
#gcc -v -E a.c


Thanks. This is helpful. Although it isn't acceptable for certification-level testing, it does tell me a lot about how I can design an environmental enquiry program to obtain the required configuration information by acceptable means (i.e. by running a conforming C test program that discovers what the config is rather than simply by asking gcc to say it).

I'm currently putting together a prototype system written in Tcl that will generate the required conforming C test programs. More when I've got it up and running and have played with it a bit.

###### Added 23:54 GMT+1 2018-05-22

I've got the first results from my Tcl test system and have started a new thread entitled

Determining C compiler implementation characteristics #####

_________________
Sometimes I post mindfully, sometimes not mindfully, and sometimes both mindfully and not mindfully. It all depends on whether and when my mind goes walkies while I'm posting Confused
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 3 of 3 [35 Posts]   Goto page: Previous 1, 2, 3
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0332s ][ Queries: 13 (0.0050s) ][ GZIP on ]