[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] master 6cd5678: Clarify compiler-pacifier in frame.c

From: Óscar Fuentes
Subject: Re: [Emacs-diffs] master 6cd5678: Clarify compiler-pacifier in frame.c
Date: Mon, 26 Aug 2019 20:20:23 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

>> > What debugging tools can make a significant difference here, and how
>> > easy/practical is it to use them?  I very much doubt they will catch
>> > every use-before-set bug anyway.
>> Valgrind tracks each byte at the machine instruction level.
>> Given the complexity of the Emacs C code, IMAO it is very useful to test
>> for this type of nasty errors. I dislike hacks that pollute the source
>> code, but on this case it is warranted.
> Does valgrind know about UNINIT?  I'd be surprised, since UNINIT is a
> source-level feature.

Valgrind knows nothing about UNINIT as it works with machine code, not
with source code. But AFAIK that macro is conditionally defined to "=0"
(for silencing bogus gcc warnings) or to nothing (for leaving the
variable uninitalized at the declaration point). The later allows
Valgrind to do a proper check.

Simply changing

int x;


int x = 0;

just for silencing the gcc warning can hide a bug that Valgrind would
detect otherwise.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]