mirror of
https://github.com/lcn2/calc.git
synced 2025-08-16 01:03:29 +03:00
Removed compiler confusing setjmp() call
In pseudo_seed(), we removed a call to setjmp() that was only there to add more information to mix into the seed. For compilers such as gcc that used -Wclobbered, the call to setjmp() gave the impression that the hash_val might be clobbered by a longjmp(). Where there is no longjmp() that would use the previous setjmp(), the gcc compiler has nil ways to notice that. So to avoid confusion we removed the setjmp() call. Thanks to <GitHub user mattdm> for raising this potential concern.
This commit is contained in:
1
seed.c
1
seed.c
@@ -592,7 +592,6 @@ pseudo_seed(void)
|
||||
sdata.size = sizeof(sdata);
|
||||
sdata.prev_hash64_copy = prev_hash64; /* load previous hash */
|
||||
sdata.call_count_copy = ++call_count; /* update call count */
|
||||
(void) setjmp(sdata.env);
|
||||
#if defined(HAVE_ENVIRON)
|
||||
sdata.environ_copy = environ;
|
||||
#endif /* HAVE_ENVIRON */
|
||||
|
Reference in New Issue
Block a user