From the documentation:
"/GF is in effect when /O1 or /O2 is used."
So... unless you are distributing debug executables, you're already
getting this with typical release configurations.
legalize+jeeves@mail.xmission.com (Richard) writes:
From the documentation:
"/GF is in effect when /O1 or /O2 is used."
So... unless you are distributing debug executables, you're already
getting this with typical release configurations.
The "announcement" was posted by "Johann", who is in my killfile,
so I didn't see it. I knew he was an arrogant troll, but I didn't
know that he posts deliberate misinformation aimed at inexperienced
C programmers.
The troll's claim was that it's a good idea to use "/GF" in Visual
Studio if you want to compare strings with "==".
This is, of course, a remarkably bad idea (and a common error by inexperienced C programmers). C strings, whether literals or not,
should be compared using strcmp() or something similar. The "=="
operator will compare their addresses.
The "/GF" option causes Visual Studio to share storage for identical
string literals. It has no effect on strings other than string
literals, so for example `s == "foo"` is still likely to fail.
If you're writing code whose behavior depends on "/GF", you're
almost certainly doing something wrong.
In comp.lang.c Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
legalize+jeeves@mail.xmission.com (Richard) writes:
From the documentation:
"/GF is in effect when /O1 or /O2 is used."
So... unless you are distributing debug executables, you're already
getting this with typical release configurations.
The "announcement" was posted by "Johann", who is in my killfile,
so I didn't see it. I knew he was an arrogant troll, but I didn't
know that he posts deliberate misinformation aimed at inexperienced
C programmers.
The troll's claim was that it's a good idea to use "/GF" in Visual
Studio if you want to compare strings with "==".
This is, of course, a remarkably bad idea (and a common error by
inexperienced C programmers). C strings, whether literals or not,
should be compared using strcmp() or something similar. The "=="
operator will compare their addresses.
The "/GF" option causes Visual Studio to share storage for identical
string literals. It has no effect on strings other than string
literals, so for example `s == "foo"` is still likely to fail.
If you're writing code whose behavior depends on "/GF", you're
almost certainly doing something wrong.
Kinda had a feel it was straight out of chatGPT or similar.
On 11/08/2026 06:02, R Kym Horsell wrote:[snip]
In comp.lang.c Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
legalize+jeeves@mail.xmission.com (Richard) writes:Kinda had a feel it was straight out of chatGPT or similar.
From the documentation:
"/GF is in effect when /O1 or /O2 is used."
So... unless you are distributing debug executables, you're already
getting this with typical release configurations.
The "announcement" was posted by "Johann", who is in my killfile,
so I didn't see it. I knew he was an arrogant troll, but I didn't
know that he posts deliberate misinformation aimed at inexperienced
C programmers.
The troll's claim was that it's a good idea to use "/GF" in Visual
Studio if you want to compare strings with "==".
This is, of course, a remarkably bad idea (and a common error by
inexperienced C programmers). C strings, whether literals or not,
should be compared using strcmp() or something similar. The "=="
operator will compare their addresses.
The "/GF" option causes Visual Studio to share storage for identical
string literals. It has no effect on strings other than string
literals, so for example `s == "foo"` is still likely to fail.
If you're writing code whose behavior depends on "/GF", you're
almost certainly doing something wrong.
I doubt it.
David Brown <david.brown@hesbynett.no> writes:
[snip][snip]
I doubt it.
I suggest that it doesn't matter, and that we shouldn't waste time >speculating about it.
"Johann" is either an arrogant troll or a computer simulation of
an arrogant troll. Either the person posting or the person running
the bot likely craves attention. Let's not provide it.
[...]
I doubt it.-a AI's regularly make silly mistakes and hallucinate things,
but in cases like this where the mistake turns up regularly in Stack Overflow and the like, I would not expect to see an AI get it wrong.
AI's are quite good at summarising information from existing sources -
it's when they are interpolating or extrapolating that they come up with bizarre things.-a[...]
In comp.lang.c Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
The troll's claim was that it's a good idea to use "/GF" in Visual
Studio if you want to compare strings with "==".
This is, of course, a remarkably bad idea (and a common error by
inexperienced C programmers). C strings, whether literals or not,
should be compared using strcmp() or something similar. The "=="
operator will compare their addresses.
Kinda had a feel it was straight out of chatGPT or similar.
On 2026-08-11 08:34, David Brown wrote:
[...]I doubt it.-a AI's regularly make silly mistakes and hallucinate
things, but in cases like this where the mistake turns up regularly
in Stack Overflow and the like, I would not expect to see an AI get
it wrong.
AI's are quite good at summarising information from existing sources
- it's when they are interpolating or extrapolating that they come
up with bizarre things.-a[...]
Yes, but the inherent problem with that is that this distinction is
not necessarily decidable, identifiable or visible. Unless "obvious"
you'd need own expertise or a second reliable information channel at
least to be sure. And with a reliable channel, why using AI in the
first place. I think use of AI is just convenience; a fast and single
point of access for all topics. Though some folks really "trust" in
AI. :-/
This all makes him highly irritating to people who have put a lot of
time and effort into understanding the language, and into helping others understand it (such as Keith). It makes him particularly dangerous to relative beginners who might mistake his misplaced self-confidence for authority, and believe what he writes.
Dear comp.lang.c, comp.os.ms-windows.programmer.win32,When do you compare the address of string literals ? I guess that's
and perhaps other groups that may make use of this information, but I
don't know about.
When you want to use == to compare strings such as "a", with "b" because
all your strings are constants, ...
Am 08.08.2026 um 23:39 schrieb Johann 'Myrkraverk' Oskarsson:
Dear comp.lang.c, comp.os.ms-windows.programmer.win32,When do you compare the address of string literals ?
and perhaps other groups that may make use of this information, but I
don't know about.
When you want to use == to compare strings such as "a", with "b" because
all your strings are constants, ...
very rare. Today's compilers / linkers not only join string-literals
on the same address when they're the same but any static data (comdat folding). The potential for mistakes with that seems very little for
me.
kymhorsell@gmail.com spake the secret code <115e6ta$120f$2@nnrp.usenet.blueworldhosting.com> thusly:
In comp.lang.c Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
The troll's claim was that it's a good idea to use "/GF" in Visual
Studio if you want to compare strings with "==".
This is, of course, a remarkably bad idea (and a common error by
inexperienced C programmers). C strings, whether literals or not,
should be compared using strcmp() or something similar. The "=="
operator will compare their addresses.
Kinda had a feel it was straight out of chatGPT or similar.
ChatGPT isn't that stupid and is more likely to alert you that you are
doing a meaningless address compare than an actual string compare.
On 8/11/2026 8:10 AM, Richard wrote:
kymhorsell@gmail.com spake the secret code
<115e6ta$120f$2@nnrp.usenet.blueworldhosting.com> thusly:
In comp.lang.c Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
The troll's claim was that it's a good idea to use "/GF" in Visual
Studio if you want to compare strings with "==".
This is, of course, a remarkably bad idea (and a common error by
inexperienced C programmers). C strings, whether literals or not,
should be compared using strcmp() or something similar. The "=="
operator will compare their addresses.
Kinda had a feel it was straight out of chatGPT or similar.
ChatGPT isn't that stupid and is more likely to alert you that you are
doing a meaningless address compare than an actual string compare.
Hopefully...
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> spake the secret code <115g4af$b6pj$1@dont-email.me> thusly:
On 8/11/2026 8:10 AM, Richard wrote:
kymhorsell@gmail.com spake the secret code
<115e6ta$120f$2@nnrp.usenet.blueworldhosting.com> thusly:
In comp.lang.c Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
The troll's claim was that it's a good idea to use "/GF" in Visual
Studio if you want to compare strings with "==".
This is, of course, a remarkably bad idea (and a common error by
inexperienced C programmers). C strings, whether literals or not,
should be compared using strcmp() or something similar. The "=="
operator will compare their addresses.
Kinda had a feel it was straight out of chatGPT or similar.
ChatGPT isn't that stupid and is more likely to alert you that you are
doing a meaningless address compare than an actual string compare.
Hopefully...
Sounds to me like you haven't used it for coding, or if you did, you
haven't used it recently.
On 8/13/2026 7:09 AM, Richard wrote:
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> spake the secret
code
<115g4af$b6pj$1@dont-email.me> thusly:
On 8/11/2026 8:10 AM, Richard wrote:
kymhorsell@gmail.com spake the secret code
<115e6ta$120f$2@nnrp.usenet.blueworldhosting.com> thusly:
In comp.lang.c Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote: >>>>>> The troll's claim was that it's a good idea to use "/GF" in Visual >>>>>> Studio if you want to compare strings with "==".
This is, of course, a remarkably bad idea (and a common error by
inexperienced C programmers).-a C strings, whether literals or not, >>>>>> should be compared using strcmp() or something similar.-a The "==" >>>>>> operator will compare their addresses.
Kinda had a feel it was straight out of chatGPT or similar.
ChatGPT isn't that stupid and is more likely to alert you that you are >>>> doing a meaningless address compare than an actual string compare.
Hopefully...
Sounds to me like you haven't used it for coding, or if you did, you
haven't used it recently.
No. I code myself. Btw, I have messed around with it and the bastard
gave me some lock-free code that was simply infested with race-
conditions! So, I kind of gave up on it.
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 74 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 50:09:15 |
| Calls: | 1,100 |
| Files: | 1,339 |
| Messages: | 275,859 |