From e390a29d2f0cb98ecd4cab299d0ba1e0b2e408b2 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 10 Nov 2021 21:57:33 +0100 Subject: pkg/compiler: warn about confusing comments that fake directives It's a somewhat common mistake to write comments instead of directives: #include #define FOO BAR because that's how it's done in C. Warn about such cases. --- pkg/compiler/testdata/errors.txt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'pkg/compiler/testdata') diff --git a/pkg/compiler/testdata/errors.txt b/pkg/compiler/testdata/errors.txt index 2280d34b8..65eaf8a97 100644 --- a/pkg/compiler/testdata/errors.txt +++ b/pkg/compiler/testdata/errors.txt @@ -3,6 +3,11 @@ # Errors that happen during type checking phase. +#include "something" ### confusing comment faking a directive (rephrase if it's intentional) +#define FOO BAR ### confusing comment faking a directive (rephrase if it's intentional) +# include "something" ### confusing comment faking a directive (rephrase if it's intentional) +# incdir "dir" ### confusing comment faking a directive (rephrase if it's intentional) + foo$0(x fileoff, y int8, z buffer[in]) foo$1(x "bar") ### unexpected string "bar", expect type foo$2(x 123, y "bar") ### unexpected int 123, expect type ### unexpected string "bar", expect type -- cgit mrf-deployment