public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug driver/67425] New: -frandom-seed documentation doesn't match code, incomplete
@ 2015-09-01 17:32 msebor at gcc dot gnu.org
  0 siblings, 0 replies; only message in thread
From: msebor at gcc dot gnu.org @ 2015-09-01 17:32 UTC (permalink / raw)
  To: gcc-bugs

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.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-09-01 17:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-01 17:32 [Bug driver/67425] New: -frandom-seed documentation doesn't match code, incomplete msebor at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).