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 Fri 20 Jul 2018, 01:16
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 1 of 3 [35 Posts]   Goto page: 1, 2, 3 Next
Author Message
WIckedWitch

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

PostPosted: Wed 09 May 2018, 15:10    Post subject:  GCC hiding standard C header files
Subject description: WTF does ggc-4.8.2 put them?
 

Just tried to compile this to check order of evaluation of + in C:

Code:
#include <stdio.h>

int main(void)
{   
   char*    ordeval      =   "RR";
   int    i          =   1;   
   
   ordeval[(--i) + i)]   =   'L';
   
   return printf("+ evaluated %c%c\n", ordeval[0], ordeval[1]);
}


but gcc-4.8.2 complains with:

Code:
ordeval-plus.c:3:20: fatal error: stddef.h: No such file or directory
 #include <stddef.h>
                    ^
compilation terminated.


So, it can find <stdio.h>, but can't find <stddef.h>.

WTF?

Ideas anyone?

_________________
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 
6502coder


Joined: 23 Mar 2009
Posts: 464
Location: Western United States

PostPosted: Wed 09 May 2018, 18:47    Post subject:  

Does this help?
https://stackoverflow.com/questions/37158651/why-is-stddef-h-not-in-usr-include
Back to top
View user's profile Send private message 
jafadmin

Joined: 19 Mar 2009
Posts: 821

PostPosted: Wed 09 May 2018, 19:20    Post subject:  

do you have the devx sfs loaded for that puppy version?
Back to top
View user's profile Send private message 
WIckedWitch

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

PostPosted: Wed 09 May 2018, 23:10    Post subject:  

@ 6502coder: alas no - AFAI can tell there's no stddef.h anywhere on my HDD

@ jafadmin: can't find devx.sfs anywhere on the HDD either - do I need it?

@ both: thx for replies Smile - as a workaround, I rolled back to gcc 4.6.4, which *does* come with a stddef.h in a place where it looks for it - but I'm a bit freaked out that gcc 4.8.x seems not to come with its own stddef.h.

While I'll happily dive into to any number of problems that require me to devise efficient algorithms, configuration settings have always been the part of software engineering that p!sses me off. Whatever is systematic I can cope with but illogical configuration constraints just drive me nuts.

_________________
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: 821

PostPosted: Wed 09 May 2018, 23:27    Post subject:  

Standard puppy does not have a compiler or dev env in the initrd. Each puppy has a downloadable "devx" sfs file that you load in via the sfs loader that merges gcc, headers, and all the other essential goodies for compiling, etc.

So go to where you downloaded the initial livecd iso and download the matching "devx" sfs file and put it in the same dir as your puppy sfs, then after booting, use the sfs loader in your distro to load the devx.

Now you can R&R ..
Back to top
View user's profile Send private message 
WIckedWitch

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

PostPosted: Thu 10 May 2018, 15:35    Post subject:  

jafadmin wrote:

So go to where you downloaded the initial livecd iso and download the matching "devx" sfs file and put it in the same dir as your puppy sfs, then after booting, use the sfs loader in your distro to load the devx.

Now you can R&R ..


Yep - that fixed it - murky buckets Smile

_________________
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: 821

PostPosted: Thu 10 May 2018, 15:49    Post subject:  

WIckedWitch wrote:
jafadmin wrote:

So go to where you downloaded the initial livecd iso and download the matching "devx" sfs file and put it in the same dir as your puppy sfs, then after booting, use the sfs loader in your distro to load the devx.

Now you can R&R ..


Yep - that fixed it - murky buckets Smile


Pas de quoi
Back to top
View user's profile Send private message 
WIckedWitch

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

PostPosted: Thu 10 May 2018, 21:53    Post subject:  

@jafadmin - beats me why any gcc package should ship without its own stddef.c - but ours, sans doute, is not to reason why.

thanks again Smile

_________________
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: 821

PostPosted: Thu 17 May 2018, 10:41    Post subject:  

WIckedWitch wrote:
.. beats me why any gcc package should ship without its own stddef.c ..


stddefs.h belongs to the OS, not the compiler.
Back to top
View user's profile Send private message 
rcrsn51


Joined: 05 Sep 2006
Posts: 12219
Location: Stratford, Ontario

PostPosted: Thu 17 May 2018, 11:28    Post subject:  

In Debian Stretch, the file stddef.h is in the package libgcc-6-dev. It is a dependency of gcc-6, which is a dependency of gcc, which is a dependency of build-essential.

So in Debian, you can get a compiler environment with just one package - build-essential.

A Puppy devx will have all the equivalent stuff from its parent distro. But if all you download is a single gcc package, you won't get stddef.h.
Back to top
View user's profile Send private message 
WIckedWitch

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

PostPosted: Thu 17 May 2018, 15:35    Post subject:  

rcrsn51 wrote:

A Puppy devx will have all the equivalent stuff from its parent distro. But if all you download is a single gcc package, you won't get stddef.h.


Given that stddef.h is a standard header defined by the ISO C standards, I find it bizarre that a gcc package may not itself come with it.

Perhaps I should explain the basis for this concern. One of my professional activities is on-target C compiler validation using either the Perennial or SolidSands test suite. For proprietary embedded C compilers such as IAR, Tasking, Keil, etc. you get a *complete* C implementation with their distribution images. Running the installer gives a readily reproducible implementation, so the compiler validator can know exactly what it is that is being tested.

Contrast this with gcc-based embedded C compilers. I have yet to satisfy myself that the installation from distribution images of any such compiler is actually reproducible. Consequently, I can never know for sure exactly what it is that I have tested. I cannot confidently say that I have tested gcc-x.y because I have no reference installation against which to compare any particular installation I have made.

So much, then for compliance with the C standards. Yes, what you are testing might pass every conformance test in a validation suite - but you still cannot say unambiguously what the implementation under test actually was.

BnMMER!

_________________
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 
rcrsn51


Joined: 05 Sep 2006
Posts: 12219
Location: Stratford, Ontario

PostPosted: Thu 17 May 2018, 15:53    Post subject:  

WIckedWitch wrote:
Given that stddef.h is a standard header defined by the ISO C standards, I find it bizarre that a gcc package may not itself come with it.

I expect that jafadmin is correct about this. The gcc compiler is meant to be multi-OS. So the OS-specific stuff has been split off into a separate package.

Even then, Debian gcc is not one single package. There are a number of sub-packages that also need loading.

If you install the compiler via apt, this is all transparent.

It's only when you try to install it piece-meal that problems arise.

Quote:
Consequently, I can never know for sure exactly what it is that I have tested. I cannot confidently say that I have tested gcc-x.y because I have no reference installation against which to compare any particular installation I have made.

I don't understand this. Are you trying to load multiple gcc's into the same environment?
Back to top
View user's profile Send private message 
WIckedWitch

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

PostPosted: Thu 17 May 2018, 20:28    Post subject:  

rcrsn51 wrote:
WIckedWitch wrote:
Given that stddef.h is a standard header defined by the ISO C standards, I find it bizarre that a gcc package may not itself come with it.


I don't understand this. Are you trying to load multiple gcc's into the same environment?


I do have multiple gcc's in one environment, but that is not the problem with which I am concerned. In the UK I am qualified as an assessor for compiler testing for UKAS, the body that provides accreditation to ISO/IEC 17025 for measurement and test laboratories. To meet that standard, all assessed testing and measurement must be both repeatable and reproducible.

For compiler testing to be repeatable, it must be possible to set up a test system that has exactly the same compiler configuration as in a previous test and that matches the configuration in the user's development and build environments. If an installed gcc relies on picking up header files that it does not itself define, then how can I show that the gcc I am testing on one occasion is the same gcc that I test on a subsequent occasion? If I cannot be sure of or otherwise demonstrate this, then I have no hope of making testing repeatable.

If an installation image is complete in itself and is simply a directory structure subject to simple scalar parameterisation, then I can provide the necessary assurance of repeatability by recursively checksumming the directory tree. Otherwise I'm not sure how I can obtain such an assurance.

This is not academic quibbling. I have already had to pull out from validation assignments for gcc-based C compilers because the clients were not able to demonstrate that a cleanly installed gcc configuration is the same as they use in their development and build environments. It is because of these difficulties that I am currently developing a suite of test programs that attempt to determine by testing what the installed configuration actually is. This is also an essential precursor to configuring static analysis tools to verify C programs compiled with gcc.

_________________
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 
rcrsn51


Joined: 05 Sep 2006
Posts: 12219
Location: Stratford, Ontario

PostPosted: Thu 17 May 2018, 20:43    Post subject:  

What if your compiler is self-contained in a single squashfs module like the Puppy devx? Does that guarantee reproducibility?
Last edited by rcrsn51 on Thu 17 May 2018, 22:06; edited 1 time in total
Back to top
View user's profile Send private message 
WIckedWitch

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

PostPosted: Thu 17 May 2018, 20:51    Post subject:  

jafadmin wrote:
WIckedWitch wrote:
.. beats me why any gcc package should ship without its own stddef.c ..


stddefs.h belongs to the OS, not the compiler.


What do you mean by "belongs to the OS"? The stddef.h header is specified in the C language standards, C90, C99, etc. Certification-quality compiler testing must always be traceable to the language standard. If a compiler does not provide its own stddef.h, then that compiler cannot guarantee that it complies with the standard if it picks up a stddef.h from another source.

_________________
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 1 of 3 [35 Posts]   Goto page: 1, 2, 3 Next
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.1172s ][ Queries: 11 (0.0149s) ][ GZIP on ]