Re: AW: [clisp:clisp] New commit [7181ad] by Bruno Haible (volatile fixes -Wclobbered?)
Bruno Haible <[email protected]>
| Newsgroups | gmane.lisp.clisp.devel |
|---|---|
| Message-ID | <[email protected]> |
Jörg asked for explanations of this change. 2016-11-09 Bruno Haible <[email protected]> Fix a relevant gcc warning of type -Wclobbered. * pathname.d (direntry_to_string): Use 'volatile' to disallow a dangerous compiler optimization. The function direntry_to_string contains a call to make_HANDLER_entry_frame which expands to something that contains a setjmp() call. GCC does not guarantee that the values of all C local variables of the function are the same when the setjmp() call returns the second time. Therefore, if GCC detects that our code uses some of these variables _after_ the setjmp() call, it warns us about it. Declaring a local variable 'volatile' is a way to tell GCC to allocate it in the stack (rather than in registers), so that it will be preserved across longjmp(). The set of warnings that we see depends on the platform. I.e. on x86 we might get a warning for a variable, for which we don't get a warning on SPARC. Or vice versa. For this reason, it is important to reduce the amount of warnings from GCC, so that we have a chance to notice when new or unusual warnings appear. Bruno > -----Ursprüngliche Nachricht----- > Von: CLISP - an ANSI Common Lisp Mercurial repository [mailto:[email protected]] > Gesendet: Mittwoch, 9. November 2016 17:52 > An: CLISP - an ANSI Common Lisp Mercurial repository > Betreff: [clisp:clisp] New commit [7181ad] by Bruno Haible > > <div class="markdown_content"><p>Fix a relevant gcc warning of type -Wclobbered.</div> > > By Bruno Haible on 11/09/2016 16:08 > [**View Changes**](https://sourceforge.net/p/clisp/clisp/ci/7181ad2064e9a4720b1e56c4d21dda33d96ab183/) > ------------------------------------------------------------------------------ _______________________________________________ clisp-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/clisp-devel