DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 6th March 2023
attilio attilio is offline
Port Guard
 
Join Date: Jun 2015
Posts: 43
Default multilpe headers with the same name

Hi.
Can you explain me why header files with the same name are present in more than one place in the same system?
For example (but it's true also for other headers) look at where stdio.h is in obsd and ubuntu:
--------------------------------
downloading src.tar.gz adn sys.tar.gz of obsd 7.2, extracting and searching (now I'm working with ubuntu 20.4, forgive me):
Code:
ciccio@ciccio-81mt:~/Desktop/obsd-src$ find -name stdio.h
./include/stdio.h
./gnu/usr.bin/gcc/gcc/fixinc/tests/base/stdio.h
./gnu/llvm/libcxx/include/stdio.h  
./gnu/gcc/fixincludes/tests/base/stdio.h  
./gnu/gcc/libstdc++-v3/include/c_compatibility/stdio.h
./gnu/gcc/libstdc++-v3/include/tr1/stdio.h
./gnu/gcc/libssp/ssp/stdio.h
./gnu/lib/libstdc++/libstdc++/include/c_compatibility/stdio.h
./lib/libc/hidden/stdio.h
Those in gnu/... probably aren't used by obsd, because are of glibc and obsd doesn't use glibc. Am I right?
The first and the last, instead, I suppose are used by obsd.
----------------------------------
Searching in Ubuntu 20.4
Code:
ciccio@ciccio-81mt:/usr$ find -name stdio.h
./include/x86_64-linux-gnu/bits/stdio.h
./include/c++/9/tr1/stdio.h
./include/stdio.h
-------------------------------------
The contents of these files are different.
I suppose that the one really included in my c codes is ..../include/stdio.h.
Which is the function of the others?

Last edited by ocicat; 22nd October 2023 at 02:19 AM. Reason: Added [code] & [/code] tags for clarity.
Reply With Quote
  #2   (View Single Post)  
Old 21st October 2023
cohumat cohumat is offline
Port Guard
 
Join Date: Oct 2023
Posts: 19
Default

GCC stands for GNU C compiler
lbcxx has to do with the libc++ library

It's just me taking a wild shot in the dark but I think the reason that you are seeing the same gnu C compiler headers in multiple places on two different operating system is that the gnu tools here originally meant to be cross platform. So you could easily port them between the multitude of veracious Unixes and Unix like opperating systems for example you could theoretically code a program on Linux and with a couple changes port you peice of software to one of the BSD or even an older OS Like AT&T Bell laboratories Unix of which hjter are multiple versions. This goes back to the early days of the Free Software Foundation (FSF) when the where trying to get people to adopt the gnu mach kernel which eventually blew up in their faces spectacularly so with the wide spread fail;ure of the gnawk kernel, Everyone decided to start porting the gnu tool chain to the other Unix like operating systems.
__________________
Kindly You Buddy,

Chip
EM:firedolphin8858@gmx.us
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiler doesn't see headers in /usr/local/include puffymon OpenBSD General 2 17th September 2017 02:46 PM
gcc-4.9.3p0 missing some headers? notooth OpenBSD Packages and Ports 4 21st November 2015 04:20 PM
Viewing manpages: Headers and footers get repeated. Carpetsmoker Solaris 3 21st February 2010 02:55 AM


All times are GMT. The time now is 04:29 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick