bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MiG, -isystem and something...


From: Thomas Schwinge
Subject: Re: MiG, -isystem and something...
Date: Mon, 11 Apr 2005 22:32:29 +0200
User-agent: Mutt/1.4.2.1i

On Mon, Apr 11, 2005 at 08:59:19PM +0200, Alfred M. Szmidt wrote:
> How about making MiG ignore any unregogniced options instead?

That's not the problem.
mig (the shell script) basically works that way:
#v+
[...]
until [ $# -eq 0 ]
do
    case "$1" in
[...]
        -imacros ) cppflags="$cppflags $1 $2"; shift; shift;;
[...]
        -* ) cppflags="$cppflags $1"; shift;;
        * ) files="$files $1"; shift;;
    esac
done

for file in $files
do
    $cpp $cppflags "$file" | $migcom $migflags || exit
[...]
#v-

> I think
> it should already do that, if it doesn't, then I'd consider it a bug.

mig indeed already does that for options consisting of only one argument
(they are just added to $cppflags and thus get passed to $cpp), but that
rule failes for options that require to have a path name specified after
them: 'mig -imacros IMACROFILE -DFOO MIGFILE' needs to be transformed to
'$cpp -imacros IMACROFILE -DFOO MIGFILE' and not to
'$cpp -imacros -DFOO IMACROFILE MIGFILE' (as it would look like without
'-imacros IMACROFILE' getting catched).
The same applies to '-isystem ...'.

The problem exists because mig has to parse the whole command line to
find the options it has to handle itself and the ones that need to be
passed to $cpp.  To do that properly, it has to know about the structure
of the command line.  It currently does not know that '-isystem FILE' has
to be passed to $cpp as-is, which is what my tiny patch corrected.

Conclusion (once again): parsing is ugly and error-prone.

If Hurd-L4 still needs MiG, it's command line interface should really be
revamped.


Regards,
 Thomas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]