calling the directory…
netmeeting ils
pinging…
On 11/20/2026 3:10 PM, Simon Clubley wrote:
On 2026-11-20, Arne Vajhűj <arne@vajhoej.dk> wrote:Doesn't C require/mandate short circuiting in cases like this??
On 11/19/2026 4:25 PM, Arne Vajhűj wrote:
echo file_get_contents("http://arnepc5.vajhoej.dk/reveal.aspx") . "\n"; >>>> //echo file_get_contents("https://arnepc5.vajhoej.dk/reveal.aspx") . "\n"; >>>> echo file_get_contents("https://arnepc5.vajhoej.dk/reveal.aspx", false, >>>> stream_context_create($sslctxopts)) . "\n";And for the curious - before fix:
echo file_get_contents("HTTPS://arnepc5.vajhoej.dk/reveal.aspx") . "\n"; >>>> echo file_get_contents("httpS://arnepc5.vajhoej.dk/reveal.aspx") . "\n"; >>>
$ php another.php
Port = 80
Port = 443
Port = 80
Port = 80
use_ssl = resource->scheme && (ZSTR_LEN(resource->scheme) > 4) &&
ZSTR_VAL(resource->scheme)[4] == 's';
I really hope that line was always compiled by a short-circuiting
compiler and that line always successfully triggered short-circuiting...
Don't be surprised if everyone is now looking for similar constructs
that rely on short-circuiting to be safe.
On 2026-11-20, Arne Vajhűj <arne@vajhoej.dk> wrote:
On 11/20/2026 3:10 PM, Simon Clubley wrote:
On 2026-11-20, Arne Vajhűj <arne@vajhoej.dk> wrote:Doesn't C require/mandate short circuiting in cases like this??
On 11/19/2026 4:25 PM, Arne Vajhűj wrote:
echo file_get_contents("http://arnepc5.vajhoej.dk/reveal.aspx") . "\n"; >>>>> //echo file_get_contents("https://arnepc5.vajhoej.dk/reveal.aspx") . "\n";And for the curious - before fix:
echo file_get_contents("https://arnepc5.vajhoej.dk/reveal.aspx", false, >>>>> stream_context_create($sslctxopts)) . "\n";
echo file_get_contents("HTTPS://arnepc5.vajhoej.dk/reveal.aspx") . "\n"; >>>>> echo file_get_contents("httpS://arnepc5.vajhoej.dk/reveal.aspx") . "\n"; >>>>
$ php another.php
Port = 80
Port = 443
Port = 80
Port = 80
use_ssl = resource->scheme && (ZSTR_LEN(resource->scheme) > 4) &&
ZSTR_VAL(resource->scheme)[4] == 's';
I really hope that line was always compiled by a short-circuiting
compiler and that line always successfully triggered short-circuiting... >>>
Don't be surprised if everyone is now looking for similar constructs
that rely on short-circuiting to be safe.
As Dan has pointed out, yes. However, I absolutely hate that style of
coding (and the use of short circuiting in general) - it is way too fragile.
It depends on the compiler behaving as expected
Seriously. Please consider not using short circuiting and instead writing >your code so it works regardless of whether your compiler short-circuits
or not. (Or it suddenly decides to stop short-circuiting one day).
Oh, and before you all start mocking me, please read this:
https://www.redhat.com/en/blog/security-flaws-caused-compiler-optimizations
Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP> writes:
As Dan has pointed out, yes. However, I absolutely hate that style of >>coding (and the use of short circuiting in general) - it is way too fragile.
Must disagree. Consider the classic (ptr && *ptr) paradigm.
It depends on the compiler behaving as expected
No, it depends on the programmer being familiar with
the C (and C++) language grammar.
The chance that any C compiler (outside of a first year college
course) would not properly handle those operators correctly
is exactly zero.
Seriously. Please consider not using short circuiting and instead writing >>your code so it works regardless of whether your compiler short-circuits
or not. (Or it suddenly decides to stop short-circuiting one day).
Seriously, use the conditonal logical operators frequently and
often. They'll work correctly unto the heat death of the universe.
Oh, and before you all start mocking me, please read this:
https://www.redhat.com/en/blog/security-flaws-caused-compiler-optimizations
That has nothing to do with the conditional-and/or operators.
On 2026-11-20, Arne VajhĂžj <arne@vajhoej.dk> wrote:In general coding to protect against potential compiler
On 11/20/2026 3:10 PM, Simon Clubley wrote:
On 2026-11-20, Arne VajhĂžj <arne@vajhoej.dk> wrote:
And for the curious - before fix:
use_ssl = resource->scheme && (ZSTR_LEN(resource->scheme) > 4) &&
ZSTR_VAL(resource->scheme)[4] == 's';
I really hope that line was always compiled by a short-circuiting
compiler and that line always successfully triggered short-circuiting...
Doesn't C require/mandate short circuiting in cases like this??
As Dan has pointed out, yes. However, I absolutely hate that style of
coding (and the use of short circuiting in general) - it is way too fragile.
It depends on the compiler behaving as expected and it depends on someone
not making some edit change that happens to have the unexpected side-effect of disabling any working short circuiting.
Seriously. Please consider not using short circuiting and instead writing your code so it works regardless of whether your compiler short-circuits
or not. (Or it suddenly decides to stop short-circuiting one day).
That:
IF e1 AND e2 THEN
...
END IF
would be more readable as:
IF e1 THEN
IF e2 THEN
...
END IF
END IF
On Mon, 23 Nov 2026 16:38:33 -0500, Arne VajhĂžj wrote:
That:
IF e1 AND e2 THEN
...
END IF
would be more readable as:
IF e1 THEN
IF e2 THEN
...
END IF
END IF
Ada had âand thenâ and âor elseâ to explicitly specify short-circuit evaluation. And the Algol 68 revival is proposing something similar <https://algol68-lang.org/>.
On 2026-11-20, Arne Vajhűj <arne@vajhoej.dk> wrote:
On 11/20/2026 3:10 PM, Simon Clubley wrote:
On 2026-11-20, Arne Vajhűj <arne@vajhoej.dk> wrote:Doesn't C require/mandate short circuiting in cases like this??
On 11/19/2026 4:25 PM, Arne Vajhűj wrote:
echo file_get_contents("http://arnepc5.vajhoej.dk/reveal.aspx") . "\n"; >>>>> //echo file_get_contents("https://arnepc5.vajhoej.dk/reveal.aspx") . "\n";And for the curious - before fix:
echo file_get_contents("https://arnepc5.vajhoej.dk/reveal.aspx", false, >>>>> stream_context_create($sslctxopts)) . "\n";
echo file_get_contents("HTTPS://arnepc5.vajhoej.dk/reveal.aspx") . "\n"; >>>>> echo file_get_contents("httpS://arnepc5.vajhoej.dk/reveal.aspx") . "\n"; >>>>
$ php another.php
Port = 80
Port = 443
Port = 80
Port = 80
use_ssl = resource->scheme && (ZSTR_LEN(resource->scheme) > 4) &&
ZSTR_VAL(resource->scheme)[4] == 's';
I really hope that line was always compiled by a short-circuiting
compiler and that line always successfully triggered short-circuiting... >>>
Don't be surprised if everyone is now looking for similar constructs
that rely on short-circuiting to be safe.
As Dan has pointed out, yes. However, I absolutely hate that style of
coding (and the use of short circuiting in general) - it is way too fragile.
It depends on the compiler behaving as expected and it depends on someone
not making some edit change that happens to have the unexpected side-effect >of disabling any working short circuiting.
Seriously. Please consider not using short circuiting and instead writing >your code so it works regardless of whether your compiler short-circuits
or not. (Or it suddenly decides to stop short-circuiting one day).
Oh, and before you all start mocking me, please read this:
https://www.redhat.com/en/blog/security-flaws-caused-compiler-optimizations
Even Linux has been caught out in the past by compilers not behaving
as expected.
In article <11e24vp$265v0$1@dont-email.me>,
Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP> wrote:
As Dan has pointed out, yes. However, I absolutely hate that style of >>coding (and the use of short circuiting in general) - it is way too fragile. >>
It depends on the compiler behaving as expected and it depends on someone >>not making some edit change that happens to have the unexpected side-effect >>of disabling any working short circuiting.
I'm going to have to push back on this. Short-circuiting of
boolean operators, in C, is a defined part _of the language_ and
is specified by an international standard. If a compiler is
miscompiling them, then that's a compiler bug or a language that
is not C.
Seriously. Please consider not using short circuiting and instead writing >>your code so it works regardless of whether your compiler short-circuits
or not. (Or it suddenly decides to stop short-circuiting one day).
This begs the question: what other parts of the language should
we not use?
In C, I would like to see people stop using library functions that have
no way of doing bounded buffer copies (strcpy() and friends for example).
I would say that is a common sense thing to ask for, but after some recent CVEs it would appear common sense is not all that common.
In C++, I would like to see people stop using unchecked bounds access
(ie: []) to access containers and start using checked access (ie: at()) always instead. It's insane that [] wasn't the checked option so you got safer code by default.
BTW, I know some environments now allow [] to become checked. It would
be nice to see that left enabled in production code, especially in
today's environment.
Another minor annoyance of mine. When you write code, you are modelling
a real-world problem. I hate that people sometimes run to using signed integers by default when most of the time, unsigned integers are a more accurate match.
On 2026-11-23, Dan Cross <cross@spitfire.i.gajendra.net> wrote:
In article <11e24vp$265v0$1@dont-email.me>,
Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP> wrote:
As Dan has pointed out, yes. However, I absolutely hate that style of >>>coding (and the use of short circuiting in general) - it is way too fragile. >>>
It depends on the compiler behaving as expected and it depends on someone >>>not making some edit change that happens to have the unexpected side-effect >>>of disabling any working short circuiting.
I'm going to have to push back on this. Short-circuiting of
boolean operators, in C, is a defined part _of the language_ and
is specified by an international standard. If a compiler is
miscompiling them, then that's a compiler bug or a language that
is not C.
Seriously. Please consider not using short circuiting and instead writing >>>your code so it works regardless of whether your compiler short-circuits >>>or not. (Or it suddenly decides to stop short-circuiting one day).
This begs the question: what other parts of the language should
we not use?
In C, I would like to see people stop using library functions that have
no way of doing bounded buffer copies (strcpy() and friends for example).
I would say that is a common sense thing to ask for, but after some recent >CVEs it would appear common sense is not all that common.
Here's one I just found with a search:
https://www.tenable.com/cve/CVE-2026-80671
In C++, I would like to see people stop using unchecked bounds access
(ie: []) to access containers and start using checked access (ie: at()) >always instead. It's insane that [] wasn't the checked option so you got >safer code by default.
BTW, I know some environments now allow [] to become checked. It would
be nice to see that left enabled in production code, especially in
today's environment.
Of course, what I would _really_ like is to see safer languages used in
our critical infrastructure. Said languages should also use readable
syntax to make it easier to learn (Ada is far better than Rust here
for example).
Another minor annoyance of mine. When you write code, you are modelling
a real-world problem. I hate that people sometimes run to using signed >integers by default when most of the time, unsigned integers are a more >accurate match. That's something that's more language-neutral however,
except when dealing with languages that have unexpected side effects with >mixed signed/unsigned expressions. :-)
data: api.nasa.gov (APOD, NeoWs)
| Sysop: | cequra |
|---|---|
| Location: | Grimsby United Kingdom |
| Users: | 4 |
| Nodes: | 4 (0 / 4) |
| Uptime: | 498852:58:20 |
| Calls: | 197 |
| Files: | 8,821 |
| D/L today: |
29 files (9,432K bytes) |
| Messages: | 39,038 |