Re: question about linker

Liste des GroupesRevenir à cl c 
Sujet : Re: question about linker
De : david.brown (at) *nospam* hesbynett.no (David Brown)
Groupes : comp.lang.c
Date : 11. Dec 2024, 16:03:35
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vjc9k8$1jcad$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0
On 11/12/2024 06:37, Waldek Hebisch wrote:
David Brown <david.brown@hesbynett.no> wrote:
On 30/11/2024 18:38, Bart wrote:
It will at least work with more compiles.
>
>
And why would that matter?  No actual developer would care if their code
can be compiled by your little toy compiler, or even more complete
little tools like tcc.  Code needs to work on the compilers that are
suitable for the job - compatibility with anything else would just be a
waste of effort and missing out on useful features that makes the code
better.
 You are exagerating and that does not help communication.
That is probably a fair comment.
But in this case, I don't think it is much of an exaggeration.  Most programmers of any language do the work primarily because they are paid to do so.  I find it highly implausible that someone would pay a professional programmer to write code with a view to compatibility with tools that are not realistically useful for the task in hand, or the foreseeable future.  And for people programming for fun, learning or hobby, I can't imagine many pay much attention to supporting rare and unusual tools.
Some people aim to make their code highly portable, even beyond the tools they normally use.  But that is generally either a matter of sticking tightly to a particular C standard or an additional standard (such as POSIX).  And some types of code can be made to support multiple embedded compilers, which can mean using hooks, macros or similar tricks to conveniently support compiler-specific extensions (such as for "packing" structs, or inline assembly).
Who, however, is going to write C code and put effort into making sure it is /specifically/ portable to tools like tcc?  People interested in benchmarking or otherwise testing C compilers might.  There are probably a few people who use tcc as their main C compiler (presumably on Windows, since *nix users will need good reason to use something other than their system compiler, and that typically implies switching to something better than their system compiler).
People write code to work with the tools they use, and tools they expect to be used with the code.  They don't go out of their way to check compatibility with tools.  Thus C code written for Linux systems often won't compile with MSVC, and C code written for MSVC often won't compile with gcc or clang.
(Of course plenty of code will coincidentally work fine with tcc - it doesn't keep up with modern C standards, but it still tries to be quite conforming and it supports a number of gcc extensions.  So if you write a C library and stick to C99, for example, then it will likely work fine with tcc.)
Some code generators, including transpilers, support tcc.  If the tool is intended to be used on Windows then that makes sense since there is no default compiler there, and it makes installation easier.

 In this
group there were at least one serious poster claiming to write code
depending only on features from older C standard. 
Would that be the person who thinks that after armageddon we will all go back to using C90 on mainframes?  I'm not sure that individual can be taken seriously.
But certainly there are people who, for good reasons or bad, stick to older C standards.  If that is of interest to you, then you would want to use "gcc -std=c90 -Wpedantic", or similar, to help spot deviations from that.

People like this
presumably would care if some "toy" compiler discoverd non-compliance.
Yes, but such compilers are not good tools for that purpose.  tcc does not in any way attempt to spot deviations from any standard.  As far as I can tell from its documentation, it supports C89/C90, "many features of the new C standard: ISO C99", some gcc extensions, and some of its own TinyCC extensions.  And there is no flags for controlling these or setting "conforming" modes.

Concerning tcc, they have explicit endorsment from gawk developer:
he likes compile speed and says that gawk compiles fine using tcc.
Is that so that you can say I am wrong to claim "no one" cares about tcc support, because you have found 1 person who has used it?  I admit it - "no one" was an exaggeration.

 In may coding I use gcc extentions when I feel that there is
substantial gain.  But for significant part of my code I prefer
to portablility,
Sure - I think most of us do that.

and that may include avoiding features not
supported by lesser compilers. 
I think very few care about that bit.  I'll use a gcc extension if it makes a noticeable improvement to the code - making the source code nicer in some way, improving static error checking, or improving the efficiency of the object code.  But I certainly won't avoid a standard C feature just because some lesser compilers might not support it!

I the past tcc was not able
to compile code which I consider rather ordinary C, and due
to this and lack of support for my main target I did not use
tcc.  But tcc improved, ATM I do not know if it is good enough
for me, but it passed initial tests, so I have no reason to
disregard it.
 BTW: IME "exotic" tools and targets help with finding bugs.
So even if you do not normally need to compile with some
compiler it makes sense to check if it works.
 
Using similar quality or better tools can be an aid.  Maybe if you are not sure about something, you check with both gcc and clang instead of just one of them.  When using weaker tools (for specific embedded targets), I have used gcc as a static error checker in parallel with the actual compiler.

Date Sujet#  Auteur
26 Nov 24 * question about linker383Thiago Adams
26 Nov 24 +* Re: question about linker16Thiago Adams
26 Nov 24 i`* Re: question about linker15Bart
26 Nov 24 i `* Re: question about linker14Thiago Adams
27 Nov 24 i  +* Re: question about linker2BGB
27 Nov 24 i  i`- Re: question about linker1Bart
27 Nov 24 i  +* Re: question about linker5David Brown
27 Nov 24 i  i`* Re: question about linker4Thiago Adams
27 Nov 24 i  i +* Re: question about linker2David Brown
27 Nov 24 i  i i`- Re: question about linker1Thiago Adams
2 Dec 24 i  i `- Re: question about linker1BGB
27 Nov 24 i  `* Re: question about linker6Michael S
27 Nov 24 i   `* Re: question about linker5Thiago Adams
27 Nov 24 i    `* Re: question about linker4Michael S
27 Nov 24 i     +- Re: question about linker1David Brown
28 Nov 24 i     +- Re: question about linker1Tim Rentsch
2 Dec 24 i     `- Re: question about linker1BGB
26 Nov 24 +* Re: question about linker20Bart
26 Nov 24 i`* Re: question about linker19Thiago Adams
26 Nov 24 i `* Re: question about linker18Bart
27 Nov 24 i  +* Re: question about linker3BGB
27 Nov 24 i  i`* Re: question about linker2fir
27 Nov 24 i  i `- Re: question about linker1BGB
27 Nov 24 i  `* Re: question about linker14Bart
27 Nov 24 i   +* Re: question about linker12Thiago Adams
27 Nov 24 i   i+- Re: question about linker1Thiago Adams
27 Nov 24 i   i`* Re: question about linker10Bart
27 Nov 24 i   i +* Re: question about linker6Bart
27 Nov 24 i   i i`* Re: question about linker5Thiago Adams
27 Nov 24 i   i i +* Re: question about linker3Thiago Adams
27 Nov 24 i   i i i`* Re: question about linker2Thiago Adams
27 Nov 24 i   i i i `- Re: question about linker1Bart
27 Nov 24 i   i i `- Re: question about linker1Bart
27 Nov 24 i   i `* Re: question about linker3Thiago Adams
27 Nov 24 i   i  `* Re: question about linker2Bart
27 Nov 24 i   i   `- Re: question about linker1Thiago Adams
28 Nov 24 i   `- Re: question about linker1Tim Rentsch
27 Nov 24 `* Re: question about linker346Waldek Hebisch
27 Nov 24  `* Re: question about linker345Thiago Adams
28 Nov 24   `* Re: question about linker344Keith Thompson
28 Nov 24    `* Re: question about linker343Thiago Adams
28 Nov 24     +* Re: question about linker338Bart
28 Nov 24     i`* Re: question about linker337Keith Thompson
28 Nov 24     i `* Re: question about linker336Bart
28 Nov 24     i  `* Re: question about linker335Keith Thompson
29 Nov 24     i   `* Re: question about linker334Bart
29 Nov 24     i    +* Re: question about linker3Keith Thompson
29 Nov 24     i    i`* Re: question about linker2Bart
29 Nov 24     i    i `- Re: question about linker1Keith Thompson
29 Nov 24     i    `* Re: question about linker330David Brown
29 Nov 24     i     `* Re: question about linker329Bart
29 Nov 24     i      +- Re: question about linker1Ike Naar
29 Nov 24     i      +* Re: question about linker326Michael S
29 Nov 24     i      i+* Re: question about linker323Bart
29 Nov 24     i      ii`* Re: question about linker322Michael S
29 Nov 24     i      ii +* Re: question about linker320David Brown
29 Nov 24     i      ii i`* Re: question about linker319Bart
29 Nov 24     i      ii i +* Re: question about linker165Keith Thompson
29 Nov 24     i      ii i i`* Re: question about linker164Bart
30 Nov 24     i      ii i i `* Re: question about linker163Keith Thompson
30 Nov 24     i      ii i i  +* Re: question about linker95Waldek Hebisch
30 Nov 24     i      ii i i  i+- Re: question about linker1Keith Thompson
30 Nov 24     i      ii i i  i+* Re: question about linker3James Kuyper
30 Nov 24     i      ii i i  ii`* Re: question about linker2Michael S
3 Dec 24     i      ii i i  ii `- Re: question about linker1Tim Rentsch
1 Dec 24     i      ii i i  i`* Re: question about linker90David Brown
1 Dec 24     i      ii i i  i +* Re: question about linker88Bart
1 Dec 24     i      ii i i  i i`* Re: question about linker87David Brown
1 Dec 24     i      ii i i  i i `* Re: question about linker86Bart
2 Dec 24     i      ii i i  i i  `* Re: question about linker85David Brown
2 Dec 24     i      ii i i  i i   `* Re: question about linker84Bart
2 Dec 24     i      ii i i  i i    +* Re: question about linker78David Brown
2 Dec 24     i      ii i i  i i    i+* Re: question about linker72Janis Papanagnou
2 Dec 24     i      ii i i  i i    ii+* Re: question about linker70Bart
2 Dec 24     i      ii i i  i i    iii+* Re: question about linker68David Brown
2 Dec 24     i      ii i i  i i    iiii`* Re: question about linker67Bart
3 Dec 24     i      ii i i  i i    iiii `* Re: question about linker66David Brown
3 Dec 24     i      ii i i  i i    iiii  +* Re: question about linker53Bart
3 Dec 24     i      ii i i  i i    iiii  i`* Re: question about linker52David Brown
3 Dec 24     i      ii i i  i i    iiii  i `* Re: question about linker51Bart
4 Dec 24     i      ii i i  i i    iiii  i  `* Re: question about linker50David Brown
4 Dec 24     i      ii i i  i i    iiii  i   `* Re: question about linker49Bart
4 Dec 24     i      ii i i  i i    iiii  i    `* Re: question about linker48David Brown
4 Dec 24     i      ii i i  i i    iiii  i     +* Re: question about linker24Bart
5 Dec 24     i      ii i i  i i    iiii  i     i`* Re: question about linker23David Brown
5 Dec 24     i      ii i i  i i    iiii  i     i +- Re: question about linker1Janis Papanagnou
5 Dec 24     i      ii i i  i i    iiii  i     i `* Re: question about linker21Bart
6 Dec 24     i      ii i i  i i    iiii  i     i  `* Re: question about linker20David Brown
6 Dec 24     i      ii i i  i i    iiii  i     i   `* Re: question about linker19Bart
6 Dec 24     i      ii i i  i i    iiii  i     i    +* Re: question about linker5Ike Naar
6 Dec 24     i      ii i i  i i    iiii  i     i    i+- Re: question about linker1Bart
7 Dec 24     i      ii i i  i i    iiii  i     i    i+- Re: question about linker1Keith Thompson
7 Dec 24     i      ii i i  i i    iiii  i     i    i`* Re: question about linker2Bart
7 Dec 24     i      ii i i  i i    iiii  i     i    i `- Re: question about linker1Keith Thompson
7 Dec 24     i      ii i i  i i    iiii  i     i    +* Re: question about linker10David Brown
7 Dec 24     i      ii i i  i i    iiii  i     i    i`* Re: question about linker9Bart
7 Dec 24     i      ii i i  i i    iiii  i     i    i `* Re: question about linker8David Brown
7 Dec 24     i      ii i i  i i    iiii  i     i    i  `* Re: question about linker7Bart
7 Dec 24     i      ii i i  i i    iiii  i     i    i   `* Re: question about linker6David Brown
7 Dec 24     i      ii i i  i i    iiii  i     i    i    `* Re: question about linker5Bart
8 Dec 24     i      ii i i  i i    iiii  i     i    i     +* Re: question about linker3Ben Bacarisse
8 Dec 24     i      ii i i  i i    iiii  i     i    i     `- Re: question about linker1David Brown
8 Dec 24     i      ii i i  i i    iiii  i     i    `* Re: question about linker3Waldek Hebisch
5 Dec 24     i      ii i i  i i    iiii  i     +* Re: question about linker15Waldek Hebisch
11 Dec 24     i      ii i i  i i    iiii  i     `* Re: question about linker8James Kuyper
3 Dec 24     i      ii i i  i i    iiii  `* Re: question about linker12Bart
3 Dec 24     i      ii i i  i i    iii`- Re: question about linker1Janis Papanagnou
2 Dec 24     i      ii i i  i i    ii`- Re: question about linker1Bart
2 Dec 24     i      ii i i  i i    i`* Re: question about linker5Bart
4 Dec 24     i      ii i i  i i    `* Re: question about linker5Waldek Hebisch
1 Dec 24     i      ii i i  i `- Re: question about linker1Janis Papanagnou
30 Nov 24     i      ii i i  +* Re: question about linker44Bart
30 Nov 24     i      ii i i  +- Re: question about linker1Janis Papanagnou
1 Dec 24     i      ii i i  `* Re: question about linker22David Brown
30 Nov 24     i      ii i `* Re: question about linker153David Brown
5 Dec 24     i      ii `- Re: question about linker1Tim Rentsch
30 Nov 24     i      i`* Re: question about linker2Tim Rentsch
29 Nov 24     i      `- Re: question about linker1David Brown
28 Nov 24     `* Re: question about linker4Keith Thompson

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal