[cfe-dev] C++20 module protocol

Alexis Murzeau via cfe-dev cfe-dev at lists.llvm.org
Tue May 26 02:58:15 PDT 2020


Le 18/05/2020 à 17:36, cfe-dev at lists.llvm.org (Nathan Sidwell via
cfe-dev) a écrit :
> Hi,
[...]
> 
> --
> Nathan Sidwell

First, thanks for you works on modules !

I've few comments that might be already discussed elsewhere and maybe
off-topic, but still:

> 
> @item |@var{program}@r{[}?@var{ident}@r{]} @r{[}@var{args...}@r{]}
> A program to spawn, and communicate with on its stdin/stdout streams.
> Your @var{PATH} environment variable is searched for the program.
> Arguments are separated by space characters, (it is not possible for
> one of the arguments delivered to the program to contain a space).

Would adding a way to quote arguments feasible to allow spaces without
constraints ? For example if the program need a path argument.


> 
> @item @var{from}
> The source path of the file containing the import or include.

This metavariable is not mentioned elsewhere and seems unused, is it
intended ?


> 
> @item @var{module}
> A module name.  Header unit names are absolute pathnames, or
> pathnames prefixed with @samp{./}.  Header units are resolved using
> the include path.

This means that when using a mapping file, which is:
----
A mapping file consisting of space-separated module-name, filename
pairs, one per line
----
Then, the header path can't contain any whitespaces for this case.

If a quoting system is too much complexity, using for example the tab
character instead of a space might be better, since a path probably
never contains the tab character.

(I'm thinking about Windows where programs are usually installed in
C:/Program Files, which have a whitespace. There are also all users that
have a whitespace somewhere for some reason, because it wasn't an issue
before and would like to use modules nevertheless).

Everything else seems perfect and simple enough, but I'm bit worried
about this space character constaint on path that might cause issues
depending on which mapper system will become the most popular in the future.

-- 
Alexis Murzeau
PGP: B7E6 0EBB 9293 7B06 BDBC  2787 E7BD 1904 F480 937F


More information about the cfe-dev mailing list