Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.c    |    Meh, in C you gotta define EVERYTHING    |    243,242 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 242,203 of 243,242    |
|    David Brown to bart    |
|    Re: _BitInt(N)    |
|    28 Nov 25 11:41:21    |
      From: david.brown@hesbynett.no              On 27/11/2025 18:13, bart wrote:       > On 27/11/2025 13:02, David Brown wrote:       >> On 27/11/2025 13:20, bart wrote:       >              I'm snipping most of this, because I don't think we are getting anywhere       except down angry rabbit holes. Most of what we both have written has       been said many times before, and I don't want to re-hash old fights.       They bring out the worst in both of us, and we both get frustrated and       annoyed. I'd rather reset the conversation before it gets out of hand,       and go back to exchanging opinions and ideas, and helping out.                     >>> (This only seems to work with gcc. Clang and MSVS don't like it.)       >>>       >>       >> I think you are mistaken. clang is fine with it. It is standard C99,       >> so any decent C compiler from the last 25 years will handle it fine.       >> MS gave up on bothering to make C compilers before the turn of the       >> century (they make a reasonable enough C++ compiler). Even your hero       >> tcc is fine with it (though on my attempts, it produces rubbish code -       >> maybe it needs different flags for optimisation). The C code is not       >> made invalid by the existence of C90-only compilers.       >       > I was mistaken. I used godbolt.org but it was set to C++. Presumably gcc       > has some C++ extensions that make it valid.              You are not the first person to mix that up on godbolt.org, with a       different language and/or compiler from what you thought you had.              I usually make a point of explicitly specifying the standard in the       command line arguments - that means there is no doubt about what I am       asking for. And if you specify a C standard with g++, you will get an       error message (unless you also use "-x c" to tell g++ that you have C code).              My standard options are :               -std=c17 -Wall -Wextra -Wpedantic -O2                     Of course I will vary the standard according to need - so for looking at       _BitInt, I have -std=c23. I sometimes use -std=gnu17 or similar when I       specifically want to use gcc extensions - in which case "-Wpedantic" is       basically pointless. And for C++, I use appropriate C++ standards.       Note that without an explicit "-std=" option, gcc will use a "gnuXX"       version that depends on the compiler version. Thus gcc extensions are       accepted by default.              "-Wall -Wextra" enable lots of warnings. For real work, I have       fine-tuned warning sets - I don't want all of these sets, and I want       some warnings that are not in these sets, but they give a good starting       point for code snippets on godbolt.              "-Wpedantic" gives warnings on deviations from the standard. It will       give you warnings if you accidentally use a gcc extension (such as using       compound literals in C++). I don't think gcc is perfectly conforming       with "-std=c?? -Wpedantic", but it is as close as any other compiler I       have seen, and is IMHO the best starting point for checks.              And I almost always have -O2. -O3 can sometimes lead to overwhelming       amounts of extra inline code that make the assembly hard to follow. -O0       generates unreadably bad assembly. -O1 is easier to follow. But for       me, -O2 is generally the sweet spot. I have no real interest in using a       compiler that doesn't do decent optimisation - if I am happy with slow       code, I'll use Python.              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca