Warning: mysqli::__construct(): (HY000/1203): User howardkn already has more than 'max_user_connections' active connections in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\includes\artfuncs.php on line 21
Failed to connect to MySQL: (1203) User howardkn already has more than 'max_user_connections' active connectionsPath: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: David Brown
Newsgroups: comp.lang.c
Subject: Re: C23 thoughts and opinions
Date: Mon, 27 May 2024 10:45:28 +0200
Organization: A noiseless patient Spider
Lines: 52
Message-ID:
References:
<7d0e8f25-a8ba-4995-9b90-ff35f85d423f@gmail.com>
<20240525142325.517@kylheku.com>
<871q5o29af.fsf@nosuchdomain.example.com>
<20240526153913.00007f65@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 27 May 2024 10:45:29 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="7989d793cb4f5bb8f14025e7e8038ebf";
logging-data="4159913"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/kSg9v+2Gi9pnBE3cdBN4+pNMATwQCLUY="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:UPlpxBWGUfTbjfkSoV8YnX9R6Tc=
Content-Language: en-GB
In-Reply-To:
Bytes: 3936
On 26/05/2024 19:11, jak wrote:
> David Brown ha scritto:
>> On 26/05/2024 17:10, jak wrote:
>>> ?
>>> I really wrote that something similar (similar != equal) did g++ and
>>> that, if you write c++ code in a file with the .c extension, the g++
>>> compile it. I never wrote that it was automatically recognized.
>>> In addition, you just explained why g++ compile a .c that contains c++
>>> code. I don't understand: no what?
>>>
>>
>> I made an error here - "g++ foo.c" /will/ treat the file as C++. I
>> apologise for that, as it made things a lot more confusing.
>>
>> But that is not what you wrote. Perhaps you didn't write what you
>> intended to write. You said that g++ somehow determines whether to
>> compile code as C or C++ based on the /contents/ of the file, not the
>> filename suffix. And that is completely wrong.
>>
>> You also mixed up ".c" and ".C". gcc considers ".c" to be C code,
>> while ".C" (with a capital C) is considered C++.
>>
>>
>
> Sorry but no. I wrote that there are compilers who do it and when they
> replied, bringing the gcc as an example, I replied that the g++ does
> something similar.
>
> and no, I have not confused the .c with the .C:
>
You /did/ mix these things up - the Usenet posts are there for you, me,
or anyone else to read. But there seems little doubt now that you
understand the difference between "gcc" and "g++", and between ".c" and
".C". So I assume the mixup was a language issue - I fully understand
that it's not always easy to communicate accurately in a different
language, and even when you are as good as you are in English, sometimes
there are miscommunications.
Whichever compiler you use, I strongly recommend using only ".c" for C
files, and only ".cpp" for C++ files. There are several other
extensions used for C++, but IME ".cpp" is the most commonly used and
supported by all C++ tools on all platforms. ".C" (capital C) is a poor
choice - it's hard to distinguish from ".c" (small C), and it will drive
Windows users crazy. And if you use gcc, then unless you can stick to a
pure C++ setup and never use C, I recommend using "gcc" rather than
"g++" for everything except the final linking stage (and even that is
optional). The "gcc" driver program does the right thing.