GCC MELT builtin strings

1 view
Skip to first unread message

Basile Starynkevitch

unread,
Sep 24, 2011, 10:55:14 AM9/24/11
to gcc-...@googlegroups.com

Hello,

As you probably know, GCC MELT have some wired-in strings, notably:

const char melt_source_dir[] = MELT_SOURCE_DIR;
const char melt_module_dir[] = MELT_MODULE_DIR;
const char melt_module_make_command[] = MELT_MODULE_MAKE_COMMAND;
const char melt_module_makefile[] = MELT_MODULE_MAKEFILE;
const char melt_module_cflags[] = MELT_MODULE_CFLAGS;
const char melt_default_modlis[] = MELT_DEFAULT_MODLIS;


I have some hard time in defining them in all cases. One of the issues is that the build
process "unquotes" them thru various shell invocations. For instance, the current
MELT trunk 179143 don't build as a plugin...

In particular, I don't know if I should be concerned by special characters in them,
notably those needed to be escaped when appearing in C string constants (backslashes,
quotes, control-characters etc).

Should this be a concern or not?

For instance, several of them depends upon the installation PREFIX.

Could it happen that the installation PREFIX contains strange characters? (backslashes,
accentuated characters, spaces, ...) - for instance, any person without root access is
likely to install MELT with a $HOME or $HOME/public value ./configure-d as prefix. I
don't know if every chinese (or even french) user have ASCII only characters in his $HOME.

Do you know of a standard or common way (shell like) to convert a string into a C
constant.

Or should I simply suppose that in every realistic scenario none of these strings are
naughty?

Perhaps I should generate the constant in a #include-d "melt-runtime-constants.c" file?

Regards.


PS. The most difficult is melt_module_cflags since it always have spaces in it, and it
might have quotes inside.
--
Basile STARYNKEVITCH http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mine, sont seulement les miennes} ***

Reply all
Reply to author
Forward
0 new messages