[Bug other/96287] New: Empty string argument to gcc should be ignored

andreas.urban at hotmail dot com gcc-bugzilla@gcc.gnu.org
Wed Jul 22 15:07:16 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96287

            Bug ID: 96287
           Summary: Empty string argument to gcc should be ignored
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: andreas.urban at hotmail dot com
  Target Milestone: ---

Passing an empty string to GCC makes it look for a file named as such:

$ gcc --version
gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
$ gcc
gcc: fatal error: no input files
compilation terminated.
$ gcc ""
gcc: error: : No such file or directory
gcc: fatal error: no input files
compilation terminated.

This is inconvenient for shells invoking other programs with a list of
arguments, such as Perl, Ruby, and Tcl, as you would have to remove the empty
strings from the argument list before executing command.

My suggestion is to have gcc ignore empty string arguments instead of treating
it as a filename. This will make integration with said languages and others
simpler at almost no cost.

Since empty string is not a supported filename for any mainstream filesystem,
and a terrible choice of name where supported, I see no apparent risk of
compatibility problems.

"Define errors out of existence" - John Ousterhout


More information about the Gcc-bugs mailing list