On Tue, 25 Oct 2011, Richard Guenther wrote: > Joseph, does this look like a sensible use of the common > machinery? Do we want the init from COLLECT_GCC_OPTIONS > in opts-common.c instead?
Certainly there should be a single function to process COLLECT_GCC_OPTIONS into an array of strings, even if only this one place needs then to convert them to logical options. And that single function should actually work properly with the quoting logic used in gcc.c to generate COLLECT_GCC_OPTIONS - your code appears to ignore any possibility of '\'' being used for single-quotes in strings, and collect2.c:extract_string, which is rather closer to what I'd expect, fails to reset backquote to 0 after processing the \'. Note that decode_cmdline_options_to_array expects the array to start with argv[0], the program name (though it's OK to have NULL there). -- Joseph S. Myers jos...@codesourcery.com