This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug driver/67425] New: -frandom-seed documentation doesn't match code, incomplete
- From: "msebor at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 01 Sep 2015 17:32:08 +0000
- Subject: [Bug driver/67425] New: -frandom-seed documentation doesn't match code, incomplete
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67425
Bug ID: 67425
Summary: -frandom-seed documentation doesn't match code,
incomplete
Product: gcc
Version: 5.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: driver
Assignee: unassigned at gcc dot gnu.org
Reporter: msebor at gcc dot gnu.org
Target Milestone: ---
As discussed in the thread referenced below, the online documentation of the
-frandom-seed option doesn't match its implementation in GCC 5.1.
Specifically, while in GCC 4.9 and before, the option is documented to take a
string as an argument, in GCC 5 it's documented to take a number, even though
GCC still accepts arbitrary strings.
https://gcc.gnu.org/ml/gcc-help/2015-08/msg00169.html
I see two possible solutions: Either revert the documentation change to
specify that the option takes a number, or adjust the implementation of the
option to match the new documentation. If the former, a test case should be
added to verify that the option can, in fact, accept a string argument and
handles it correctly (i.e., by computing its CRC32 value and using that as the
random seed). Currently there's only one test case for the option and it
specifies a hex argument (gcc itself seems to use the option with an argument
of 0).
The option change was introduced in r216773:
commit cf357977a8d0eadddf7f2f248553519dc622ffb8
Author: ygribov <ygribov@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Tue Oct 28 09:46:29 2014 +0000
Allow to override Asan shadow offset.
2014-10-28 Yury Gribov <y.gribov@samsung.com>
gcc/
* asan.c (set_asan_shadow_offset): New function.
(asan_shadow_offset): Likewise.
(asan_emit_stack_protection): Call asan_shadow_offset.
(build_shadow_mem_access): Likewise.
* asan.h (set_asan_shadow_offset): Declare.
* common.opt (fasan-shadow-offset): New option.
(frandom-seed): Fixed parameter name.
* doc/invoke.texi (fasan-shadow-offset): Describe new option.
(frandom-seed): Fixed parameter name.
* opts-global.c (handle_common_deferred_options): Handle
-fasan-shadow-offset.
* opts.c (common_handle_option): Likewise.
gcc/testsuite/
* c-c++-common/asan/shadow-offset-1.c: New test.