diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2017-12-13 10:09:10 +0100 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2017-12-16 16:31:06 +0100 |
| commit | 2f922ba822da324ccd2c201c076ca94d5e910a8a (patch) | |
| tree | 81e974ae6715fddcafca18f2e97076e718fa7c5e /validation | |
| parent | 5a24ca94da070e86352b9f5b84c1a6afd94d283e (diff) | |
| download | sparse-dev-2f922ba822da324ccd2c201c076ca94d5e910a8a.tar.gz | |
fix: spaces in macro definition on the command line
GCC's manual or POSIX say about the '-D' option something like:
'−D name[=value]' should be treated as if in directive
'#define name value' (with '1' as default for the value),
including its tokenization.
So an option like '-DM(X, Y)=...' should be processed like a
directive '#define M(X, Y) ...'.
However, the current code treat a space as a separator between
the macro and its definition, just like the '='. As consequence,
the above option is processed like the directive would be
'#define M(X, Y)=...', with 'M(X,' as the macro (name) and
'Y)=...' as its definition.
Fix this by stopping to treat the space character specially,
thus only using '=' as the separator.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation')
| -rw-r--r-- | validation/preprocessor/cli-D-space.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/validation/preprocessor/cli-D-space.c b/validation/preprocessor/cli-D-space.c index d104d66d..8343bf1a 100644 --- a/validation/preprocessor/cli-D-space.c +++ b/validation/preprocessor/cli-D-space.c @@ -2,7 +2,6 @@ M(0,1) /* * check-name: cli: allow spaces in macros * check-command: sparse -E '-DM(X, Y)=a' $file - * check-known-to-fail * * check-output-start |
