Re: [pretest] regression in pdftex
Jim Diamond <[email protected]> Wed, 18 Feb 2026 10:03:49 -0400
| Newsgroups | gmane.comp.tex.live |
|---|---|
| Message-ID | <[email protected]> |
On Wed, Feb 18, 2026 at 10:05 (+0000), Norman Gray wrote:
> Karl and all, hello.
> On 17 Feb 2026, at 23:31, Karl Berry wrote:
>> different compilers initialised it differently by default.
>> Or left it uninitialized, making the value is effectively random. That's
>> what "normal" compilers do,
> I'm sure we could bicker most agreeably about what counts as ‘normal’ here!
>> not blatantly force initialization to
>> zero. I'm surprised to hear that clang does that.
> I see it's controlled by an option -ftrivial-auto-var-init in the
> intimidatingly long list of clang compiler options, and it appears that
> the default value of it has changed more than once (and I see there was
> at one time a clang option
> -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang),
> so one gets the sense that opinions differ about whether this is a Good
> Thing or not.
> I appreciate it would be useful in production builds, so that the binary
> at least produces _consistent_ misbehaviour, but the downside in
> development builds is of course hiding goofs.
> Best wishes,
> [1] https://clang.llvm.org/docs/ClangCommandLineReference.html
Norman,
thanks for sharing information about those options. In particular, I like
the one that is 72 chars long.
My thoughts are similar to Karl's (and probably many other people's); I was
surprised to hear that clang would initialize automatic variables. As you
mention, it has the possibility of hiding errors, which (IMHO) is virtually
never a good thing.
I think a much better choice would be for it to initialize (otherwise
uninitialized) automatic variables to, say, -2^14 (or some other value with
a good chance of causing an immediately-noticeable problem).
I used to teach a second-year C programming course, and I used to tell my
class that the best error to have was one that caused a segmentation fault
(and thus the program was killed), because then there was no question in
anyone's mind about whether the program is correct or not. (And unless the
program was unusually complex for a second-year assignment, finding the
location of a seg fault was usually pretty easy.)
Cheers.
Jim