GCC considers __LINE__, __FILE__, ... as being defined. Add a testcase for this. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx> --- validation/preprocessor/dynamic.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 validation/preprocessor/dynamic.c diff --git a/validation/preprocessor/dynamic.c b/validation/preprocessor/dynamic.c new file mode 100644 index 000000000..3622be8d1 --- /dev/null +++ b/validation/preprocessor/dynamic.c @@ -0,0 +1,30 @@ +#if defined(__LINE__) +__LINE__ +#endif +#if defined(__FILE__) +__FILE__ +#endif +#if defined(__DATE__) +date +#endif +#if defined(__TIME__) +time +#endif +#if defined(__COUNTER__) +counter +#endif + +/* + * check-name: dynamic-macros + * check-command: sparse -E $file + * check-known-to-fail + * + * check-output-start + +2 +"preprocessor/dynamic.c" +date +time +counter + * check-output-end + */ -- 2.17.1 -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html