linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dissect: add support for _Generic
@ 2020-07-28 18:35 Alexey Gladkov
  2020-07-28 19:49 ` Oleg Nesterov
  0 siblings, 1 reply; 11+ messages in thread
From: Alexey Gladkov @ 2020-07-28 18:35 UTC (permalink / raw)
  To: linux-sparse; +Cc: Oleg Nesterov, Luc Van Oostenryck

No special support needed for _Generic, so just suppress the warning
about unknown type.

Before:

$ ./test-dissect validation/generic-functions.c

FILE: validation/generic-functions.c

  13:1                    def   f testf                            void ( ... )
  13:1   testf            def . v a                                float
validation/generic-functions.c:13:1: warning: bad expr->type: 31
  13:1   testf            -r- . v a                                float
  14:1                    def   f testd                            void ( ... )
  14:1   testd            def . v a                                double
validation/generic-functions.c:14:1: warning: bad expr->type: 31
  14:1   testd            -r- . v a                                double
  15:1                    def   f testl                            void ( ... )
  15:1   testl            def . v a                                long double
validation/generic-functions.c:15:1: warning: bad expr->type: 31
  15:1   testl            -r- . v a                                long double

After:

$ ./test-dissect validation/generic-functions.c

FILE: validation/generic-functions.c

  13:1                    def   f testf                            void ( ... )
  13:1   testf            def . v a                                float
  13:1   testf            -r- . v a                                float
  14:1                    def   f testd                            void ( ... )
  14:1   testd            def . v a                                double
  14:1   testd            -r- . v a                                double
  15:1                    def   f testl                            void ( ... )
  15:1   testl            def . v a                                long double
  15:1   testl            -r- . v a                                long double

Signed-off-by: Alexey Gladkov <gladkov.alexey@gmail.com>
---
 dissect.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dissect.c b/dissect.c
index ccb7897b..b494f93c 100644
--- a/dissect.c
+++ b/dissect.c
@@ -342,6 +342,7 @@ again:
 	case EXPR_TYPE:		// [struct T]; Why ???
 	case EXPR_VALUE:
 	case EXPR_FVALUE:
+	case EXPR_GENERIC:
 
 	break; case EXPR_LABEL:
 		ret = &label_ctype;
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-07-31 16:13 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-28 18:35 [PATCH] dissect: add support for _Generic Alexey Gladkov
2020-07-28 19:49 ` Oleg Nesterov
2020-07-28 23:10   ` Luc Van Oostenryck
2020-07-29 11:28     ` Oleg Nesterov
2020-07-29 14:50       ` Luc Van Oostenryck
2020-07-30 15:08         ` Oleg Nesterov
2020-07-30 20:00           ` Luc Van Oostenryck
2020-07-31 14:43             ` Oleg Nesterov
2020-07-31 16:13               ` Luc Van Oostenryck
2020-07-30 15:09     ` [PATCH] dissect: support _Generic() a bit more Oleg Nesterov
2020-07-30 20:05       ` Luc Van Oostenryck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).