This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: parameter type of -frandom-seed


On 08/27/2015 12:16 PM, Stephan Gatzka wrote:

The option argument is processed in the set_random_seed function in
toplev.c. The function takes a string argument and calls strtoul on
it to obtain the numeric random seed (strtoul is called with the base
argument of zero letting it detect it from the prefix). When strtoul
fails, set_random_seed calls crc32_string with the string argument.
So the function is capable of processing both numeric and string
arguments.

Thanks for diving into the sources.

I suppose the question is whether GCC should should be
changed back to accept string arguments as originally implemented,
or whether it should stay as is and the option specification changed
to match the documentation.

Well, I would stay with the implementation and allow strings. So
reverting the docs back to string would be fine.

I opened driver/67425 for this and outlined the two solutions we've
discussed.

Martin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]