public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Seeking advice on source of compilation errors in kernel header files
@ 2021-06-29  5:17 Vinod P
  2021-06-29  5:27 ` Jonathan Wakely
  0 siblings, 1 reply; 4+ messages in thread
From: Vinod P @ 2021-06-29  5:17 UTC (permalink / raw)
  To: gcc-help; +Cc: Vinod P

As part of my current project, I am trying to compile some proprietary device drivers on Redhat8 using the vendor supplied Makefile, which invokes gcc. Here is the complete output of the gcc -v command:

bash-4.4$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --disable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 8.3.1 20191121 (Red Hat 8.3.1-5) (GCC)

The drivers that I am trying to compile had been originally written for Redhat6, and the compilation results in a bunch of errors in system header files such as <linux/printk.h>, <linux/kernel.h> et al.

I do not wish to flood this post with specific errors, but rather what I am trying to figure out is why is it that I am seeing the errors in the kernel header files when the code is compiled on Redhat8 with the version of gcc that is included in the distribution.

I am of the view that the root cause of the errors is a possible mismatch between the compiler version and the kernel source code.

Any thoughts would be highly appreciated.

TIA
vpb

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

* Re: Seeking advice on source of compilation errors in kernel header files
  2021-06-29  5:17 Seeking advice on source of compilation errors in kernel header files Vinod P
@ 2021-06-29  5:27 ` Jonathan Wakely
  2021-06-29  6:29   ` Vinod P
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Wakely @ 2021-06-29  5:27 UTC (permalink / raw)
  To: Vinod P; +Cc: gcc-help

On Tue, 29 Jun 2021, 06:18 Vinod P wrote:

>
> The drivers that I am trying to compile had been originally written for
> Redhat6, and the compilation results in a bunch of errors in system header
> files such as <linux/printk.h>, <linux/kernel.h> et al.
>
> I do not wish to flood this post with specific errors,


Well then nobody can give you a good answer, just guesses based on your
incomplete description of the problem. Showing one or two examples of the
errors would make it possible for people to give good answers.


but rather what I am trying to figure out is why is it that I am seeing the
> errors in the kernel header files when the code is compiled on Redhat8 with
> the version of gcc that is included in the distribution.
>
> I am of the view that the root cause of the errors is a possible mismatch
> between the compiler version and the kernel source code.
>

That seems unlikely. I would guess that the reason is a mismatch between
the driver code you are compiling and the new kernel headers.



>
>

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

* Re: Seeking advice on source of compilation errors in kernel header files
  2021-06-29  5:27 ` Jonathan Wakely
@ 2021-06-29  6:29   ` Vinod P
  2021-06-29 11:18     ` Jonathan Wakely
  0 siblings, 1 reply; 4+ messages in thread
From: Vinod P @ 2021-06-29  6:29 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-help

Thanks Jonathan.

I have pasted below a sample of the nature of errors we are seeing during compilation; I have removed segments which are proprietary and replaced with PROPRIETARY:

====================================
BEGIN SAMPLE COMPILER LOG
====================================
Makefile:53: Using kernel headers from /usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include
<PROPRIETARY>
<PROPRIETARY>
In file included from /usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:15,
                 from /usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:9,
                 from /usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/module.h:9,
                 from <PROPRIETARY>:41:
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/printk.h:145:24: error: expected declaration specifiers or ‘...’ before numeric constant
 static inline __printf(1, 2) __cold
                        ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/printk.h:145:27: error: expected declaration specifiers or ‘...’ before numeric constant
 static inline __printf(1, 2) __cold
                           ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/printk.h:208:24: error: expected declaration specifiers or ‘...’ before numeric constant
 static inline __printf(1, 0)
                        ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/printk.h:208:27: error: expected declaration specifiers or ‘...’ before numeric constant
 static inline __printf(1, 0)
                           ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/printk.h:213:24: error: expected declaration specifiers or ‘...’ before numeric constant
 static inline __printf(1, 2) __cold
                        ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/printk.h:213:27: error: expected declaration specifiers or ‘...’ before numeric constant
 static inline __printf(1, 2) __cold
                           ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/printk.h:218:24: error: expected declaration specifiers or ‘...’ before numeric constant
 static inline __printf(1, 2) __cold
                        ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/printk.h:218:27: error: expected declaration specifiers or ‘...’ before numeric constant
 static inline __printf(1, 2) __cold
                           ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/printk.h:255:24: error: expected declaration specifiers or ‘...’ before numeric constant
 static inline __printf(1, 2) void dump_stack_set_arch_desc(const char *fmt, ...)
                        ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/printk.h:255:27: error: expected declaration specifiers or ‘...’ before numeric constant
 static inline __printf(1, 2) void dump_stack_set_arch_desc(const char *fmt, ...)
                           ^
In file included from /usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:9,
                 from /usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/module.h:9,
                 from <PROPRIETARY>:41:
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:272:10: error: expected declaration specifiers or ‘...’ before numeric constant
 __printf(1, 2)
          ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:272:13: error: expected declaration specifiers or ‘...’ before numeric constant
 __printf(1, 2)
             ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h: In function ‘do_exit’:
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:279:31: error: expected declaration specifiers before ‘__noreturn’
 void do_exit(long error_code) __noreturn;
                               ^~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:280:51: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__noreturn’
 void complete_and_exit(struct completion *, long) __noreturn;
                                                   ^~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:286:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 { }
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:312:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:315:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:322:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_kstrtoul’
 int __must_check _kstrtoul(const char *s, unsigned int base, unsigned long *res);
                  ^~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:323:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_kstrtol’
 int __must_check _kstrtol(const char *s, unsigned int base, long *res);
                  ^~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:325:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘kstrtoull’
 int __must_check kstrtoull(const char *s, unsigned int base, unsigned long long *res);
                  ^~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:326:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘kstrtoll’
 int __must_check kstrtoll(const char *s, unsigned int base, long long *res);
                  ^~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:344:32: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘kstrtoul’
 static inline int __must_check kstrtoul(const char *s, unsigned int base, unsigned long *res)
                                ^~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:373:32: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘kstrtol’
 static inline int __must_check kstrtol(const char *s, unsigned int base, long *res)
                                ^~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:386:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘kstrtouint’
 int __must_check kstrtouint(const char *s, unsigned int base, unsigned int *res);
                  ^~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:387:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘kstrtoint’
 int __must_check kstrtoint(const char *s, unsigned int base, int *res);
                  ^~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:389:32: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘kstrtou64’
 static inline int __must_check kstrtou64(const char *s, unsigned int base, u64 *res)
                                ^~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:394:32: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘kstrtos64’
 static inline int __must_check kstrtos64(const char *s, unsigned int base, s64 *res)
                                ^~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:399:32: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘kstrtou32’
 static inline int __must_check kstrtou32(const char *s, unsigned int base, u32 *res)
                                ^~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:404:32: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘kstrtos32’
 static inline int __must_check kstrtos32(const char *s, unsigned int base, s32 *res)
                                ^~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:409:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘kstrtou16’
 int __must_check kstrtou16(const char *s, unsigned int base, u16 *res);
                  ^~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:410:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘kstrtos16’
 int __must_check kstrtos16(const char *s, unsigned int base, s16 *res);
                  ^~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:411:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘kstrtou8’
 int __must_check kstrtou8(const char *s, unsigned int base, u8 *res);
                  ^~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:412:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘kstrtos8’
 int __must_check kstrtos8(const char *s, unsigned int base, s8 *res);
                  ^~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:413:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘kstrtobool’
 int __must_check kstrtobool(const char *s, bool *res);
                  ^~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:415:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘kstrtoull_from_user’
 int __must_check kstrtoull_from_user(const char __user *s, size_t count, unsigned int base, unsigned long long *res);
                  ^~~~~~~~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:416:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘kstrtoll_from_user’
 int __must_check kstrtoll_from_user(const char __user *s, size_t count, unsigned int base, long long *res);
                  ^~~~~~~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:417:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘kstrtoul_from_user’
 int __must_check kstrtoul_from_user(const char __user *s, size_t count, unsigned int base, unsigned long *res);
                  ^~~~~~~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:418:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘kstrtol_from_user’
 int __must_check kstrtol_from_user(const char __user *s, size_t count, unsigned int base, long *res);
                  ^~~~~~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:419:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘kstrtouint_from_user’
 int __must_check kstrtouint_from_user(const char __user *s, size_t count, unsigned int base, unsigned int *res);
                  ^~~~~~~~~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:420:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘kstrtoint_from_user’
 int __must_check kstrtoint_from_user(const char __user *s, size_t count, unsigned int base, int *res);
                  ^~~~~~~~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:421:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘kstrtou16_from_user’
 int __must_check kstrtou16_from_user(const char __user *s, size_t count, unsigned int base, u16 *res);
                  ^~~~~~~~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:422:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘kstrtos16_from_user’
 int __must_check kstrtos16_from_user(const char __user *s, size_t count, unsigned int base, s16 *res);
                  ^~~~~~~~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:423:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘kstrtou8_from_user’
 int __must_check kstrtou8_from_user(const char __user *s, size_t count, unsigned int base, u8 *res);
                  ^~~~~~~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:424:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘kstrtos8_from_user’
 int __must_check kstrtos8_from_user(const char __user *s, size_t count, unsigned int base, s8 *res);
                  ^~~~~~~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:425:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘kstrtobool_from_user’
 int __must_check kstrtobool_from_user(const char __user *s, size_t count, bool *res);
                  ^~~~~~~~~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:427:32: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘kstrtou64_from_user’
 static inline int __must_check kstrtou64_from_user(const char __user *s, size_t count, unsigned int base, u64 *res)
                                ^~~~~~~~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:432:32: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘kstrtos64_from_user’
 static inline int __must_check kstrtos64_from_user(const char __user *s, size_t count, unsigned int base, s64 *res)
                                ^~~~~~~~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:437:32: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘kstrtou32_from_user’
 static inline int __must_check kstrtou32_from_user(const char __user *s, size_t count, unsigned int base, u32 *res)
                                ^~~~~~~~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:442:32: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘kstrtos32_from_user’
 static inline int __must_check kstrtos32_from_user(const char __user *s, size_t count, unsigned int base, s32 *res)
                                ^~~~~~~~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:449:22: error: storage class specified for parameter ‘simple_strtoul’
 extern unsigned long simple_strtoul(const char *,char **,unsigned int);
                      ^~~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:450:13: error: storage class specified for parameter ‘simple_strtol’
 extern long simple_strtol(const char *,char **,unsigned int);
             ^~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:451:27: error: storage class specified for parameter ‘simple_strtoull’
 extern unsigned long long simple_strtoull(const char *,char **,unsigned int);
                           ^~~~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:452:18: error: storage class specified for parameter ‘simple_strtoll’
 extern long long simple_strtoll(const char *,char **,unsigned int);
                  ^~~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:454:12: error: storage class specified for parameter ‘num_to_str’
 extern int num_to_str(char *buf, int size,
            ^~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:459:17: error: expected declaration specifiers or ‘...’ before numeric constant
 extern __printf(2, 3) int sprintf(char *buf, const char * fmt, ...);
                 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:459:20: error: expected declaration specifiers or ‘...’ before numeric constant
 extern __printf(2, 3) int sprintf(char *buf, const char * fmt, ...);
                    ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:460:17: error: expected declaration specifiers or ‘...’ before numeric constant
 extern __printf(2, 0) int vsprintf(char *buf, const char *, va_list);
                 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:460:20: error: expected declaration specifiers or ‘...’ before numeric constant
 extern __printf(2, 0) int vsprintf(char *buf, const char *, va_list);
                    ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:461:17: error: expected declaration specifiers or ‘...’ before numeric constant
 extern __printf(3, 4)
                 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:461:20: error: expected declaration specifiers or ‘...’ before numeric constant
 extern __printf(3, 4)
                    ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:463:17: error: expected declaration specifiers or ‘...’ before numeric constant
 extern __printf(3, 0)
                 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:463:20: error: expected declaration specifiers or ‘...’ before numeric constant
 extern __printf(3, 0)
                    ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:465:17: error: expected declaration specifiers or ‘...’ before numeric constant
 extern __printf(3, 4)
                 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:465:20: error: expected declaration specifiers or ‘...’ before numeric constant
 extern __printf(3, 4)
                    ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:467:17: error: expected declaration specifiers or ‘...’ before numeric constant
 extern __printf(3, 0)
                 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:467:20: error: expected declaration specifiers or ‘...’ before numeric constant
 extern __printf(3, 0)
                    ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:469:17: error: expected declaration specifiers or ‘...’ before numeric constant
 extern __printf(2, 3) __malloc
                 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:469:20: error: expected declaration specifiers or ‘...’ before numeric constant
 extern __printf(2, 3) __malloc
                    ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:471:17: error: expected declaration specifiers or ‘...’ before numeric constant
 extern __printf(2, 0) __malloc
                 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:471:20: error: expected declaration specifiers or ‘...’ before numeric constant
 extern __printf(2, 0) __malloc
                    ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:473:17: error: expected declaration specifiers or ‘...’ before numeric constant
 extern __printf(2, 0)
                 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:473:20: error: expected declaration specifiers or ‘...’ before numeric constant
 extern __printf(2, 0)
                    ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:476:16: error: expected declaration specifiers or ‘...’ before numeric constant
 extern __scanf(2, 3)
                ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:476:19: error: expected declaration specifiers or ‘...’ before numeric constant
 extern __scanf(2, 3)
                   ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:478:16: error: expected declaration specifiers or ‘...’ before numeric constant
 extern __scanf(2, 0)
                ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:478:19: error: expected declaration specifiers or ‘...’ before numeric constant
 extern __scanf(2, 0)
                   ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:481:12: error: storage class specified for parameter ‘get_option’
 extern int get_option(char **str, int *pint);
            ^~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:482:14: error: storage class specified for parameter ‘get_options’
 extern char *get_options(const char *str, int nints, int *ints);
              ^~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:483:27: error: storage class specified for parameter ‘memparse’
 extern unsigned long long memparse(const char *ptr, char **retptr);
                           ^~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:484:13: error: storage class specified for parameter ‘parse_option_str’
 extern bool parse_option_str(const char *str, const char *option);
             ^~~~~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:485:14: error: storage class specified for parameter ‘next_arg’
 extern char *next_arg(char *args, char **param, char **val);
              ^~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:487:12: error: storage class specified for parameter ‘core_kernel_text’
 extern int core_kernel_text(unsigned long addr);
            ^~~~~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:488:12: error: storage class specified for parameter ‘init_kernel_text’
 extern int init_kernel_text(unsigned long addr);
            ^~~~~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:489:12: error: storage class specified for parameter ‘core_kernel_data’
 extern int core_kernel_data(unsigned long addr);
            ^~~~~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:490:12: error: storage class specified for parameter ‘__kernel_text_address’
 extern int __kernel_text_address(unsigned long addr);
            ^~~~~~~~~~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:491:12: error: storage class specified for parameter ‘kernel_text_address’
 extern int kernel_text_address(unsigned long addr);
            ^~~~~~~~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:492:12: error: storage class specified for parameter ‘func_ptr_is_kernel_text’
 extern int func_ptr_is_kernel_text(void *ptr);
            ^~~~~~~~~~~~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:505:13: error: storage class specified for parameter ‘bust_spinlocks’
 extern void bust_spinlocks(int yes);
             ^~~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:506:12: error: storage class specified for parameter ‘oops_in_progress’
 extern int oops_in_progress;  /* If set, an oops, panic(), BUG() or die() is in progress */
            ^~~~~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:507:12: error: storage class specified for parameter ‘panic_timeout’
 extern int panic_timeout;
            ^~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:508:22: error: storage class specified for parameter ‘panic_print’
 extern unsigned long panic_print;
                      ^~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:509:12: error: storage class specified for parameter ‘panic_on_oops’
 extern int panic_on_oops;
            ^~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:510:12: error: storage class specified for parameter ‘panic_on_unrecovered_nmi’
 extern int panic_on_unrecovered_nmi;
            ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:511:12: error: storage class specified for parameter ‘panic_on_io_nmi’
 extern int panic_on_io_nmi;
            ^~~~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:512:12: error: storage class specified for parameter ‘panic_on_warn’
 extern int panic_on_warn;
            ^~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:513:22: error: storage class specified for parameter ‘panic_on_taint’
 extern unsigned long panic_on_taint;
                      ^~~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:514:13: error: storage class specified for parameter ‘panic_on_taint_nousertaint’
 extern bool panic_on_taint_nousertaint;
             ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:515:12: error: storage class specified for parameter ‘sysctl_panic_on_rcu_stall’
 extern int sysctl_panic_on_rcu_stall;
            ^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:516:12: error: storage class specified for parameter ‘sysctl_panic_on_stackoverflow’
 extern int sysctl_panic_on_stackoverflow;
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:518:13: error: storage class specified for parameter ‘crash_kexec_post_notifiers’
 extern bool crash_kexec_post_notifiers;
             ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:525:17: error: storage class specified for parameter ‘panic_cpu’
 extern atomic_t panic_cpu;
                 ^~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:533:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:537:20: error: storage class specified for parameter ‘print_tainted’
 extern const char *print_tainted(void);
                    ^~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:542:13: error: storage class specified for parameter ‘add_taint’
 extern void add_taint(unsigned flag, enum lockdep_ok);
             ^~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:543:12: error: storage class specified for parameter ‘test_taint’
 extern int test_taint(unsigned flag);
            ^~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:544:22: error: storage class specified for parameter ‘get_taint’
 extern unsigned long get_taint(void);
                      ^~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:545:12: error: storage class specified for parameter ‘root_mountflags’
 extern int root_mountflags;
            ^~~~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:547:13: error: storage class specified for parameter ‘early_boot_irqs_disabled’
 extern bool early_boot_irqs_disabled;
             ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:561:3: error: storage class specified for parameter ‘system_state’
 } system_state;
   ^~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:607:32: error: storage class specified for parameter ‘taint_flags’
 extern const struct taint_flag taint_flags[TAINT_FLAGS_COUNT];
                                ^~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:609:19: error: storage class specified for parameter ‘hex_asc’
 extern const char hex_asc[];
                   ^~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:614:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:620:19: error: storage class specified for parameter ‘hex_asc_upper’
 extern const char hex_asc_upper[];
                   ^~~~~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:625:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:631:12: error: storage class specified for parameter ‘hex_to_bin’
 extern int hex_to_bin(char ch);
            ^~~~~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:632:25: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘hex2bin’
 extern int __must_check hex2bin(u8 *dst, const char *src, size_t count);
                         ^~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:633:14: error: storage class specified for parameter ‘bin2hex’
 extern char *bin2hex(char *dst, const void *src, size_t count);
              ^~~~~~~
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:807:40: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 static inline void tracing_start(void) { }
                                        ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:808:39: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 static inline void tracing_stop(void) { }
                                       ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:809:47: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 static inline void trace_dump_stack(int skip) { }
                                               ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:811:37: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 static inline void tracing_on(void) { }
                                     ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:812:38: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 static inline void tracing_off(void) { }
                                      ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:813:39: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 static inline int tracing_is_on(void) { return 0; }
                                       ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:814:43: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 static inline void tracing_snapshot(void) { }
                                           ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:815:49: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 static inline void tracing_snapshot_alloc(void) { }
                                                 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:817:24: error: expected declaration specifiers or ‘...’ before numeric constant
 static inline __printf(1, 2)
                        ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:817:27: error: expected declaration specifiers or ‘...’ before numeric constant
 static inline __printf(1, 2)
                           ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:822:17: error: expected declaration specifiers or ‘...’ before numeric constant
 static __printf(1, 0) inline int
                 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:822:20: error: expected declaration specifiers or ‘...’ before numeric constant
 static __printf(1, 0) inline int
                    ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:827:70: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
                                                                      ^
In file included from /usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/module.h:9,
                 from pmc421.c:41:
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:27:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:41:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:45:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:59:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:78:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:92:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:104:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:118:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:130:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:138:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:153:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:162:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:174:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:189:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:200:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:212:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:229:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:247:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:258:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:267:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:285:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:295:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:313:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:327:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:333:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:359:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:388:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:404:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:422:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:434:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:448:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:465:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:742:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:748:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:753:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:758:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:768:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:775:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:783:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:795:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:804:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:815:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:820:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:830:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^
/usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:840:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
 {
 ^

====================================
END SAMPLE COMPILER LOG
=====================================
________________________________
From: Jonathan Wakely <jwakely.gcc@gmail.com>
Sent: Tuesday, June 29, 2021 3:27 PM
To: Vinod P <vpb20201973@outlook.com>
Cc: gcc-help <gcc-help@gcc.gnu.org>
Subject: Re: Seeking advice on source of compilation errors in kernel header files



On Tue, 29 Jun 2021, 06:18 Vinod P wrote:

The drivers that I am trying to compile had been originally written for Redhat6, and the compilation results in a bunch of errors in system header files such as <linux/printk.h>, <linux/kernel.h> et al.

I do not wish to flood this post with specific errors,

Well then nobody can give you a good answer, just guesses based on your incomplete description of the problem. Showing one or two examples of the errors would make it possible for people to give good answers.


but rather what I am trying to figure out is why is it that I am seeing the errors in the kernel header files when the code is compiled on Redhat8 with the version of gcc that is included in the distribution.

I am of the view that the root cause of the errors is a possible mismatch between the compiler version and the kernel source code.

That seems unlikely. I would guess that the reason is a mismatch between the driver code you are compiling and the new kernel headers.





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

* Re: Seeking advice on source of compilation errors in kernel header files
  2021-06-29  6:29   ` Vinod P
@ 2021-06-29 11:18     ` Jonathan Wakely
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Wakely @ 2021-06-29 11:18 UTC (permalink / raw)
  To: Vinod P; +Cc: gcc-help

On Tue, 29 Jun 2021 at 07:29, Vinod P <vpb20201973@outlook.com> wrote:
>
> Thanks Jonathan.
>
> I have pasted below a sample of the nature of errors we are seeing during compilation;

I suggested that it would be helpful to show "one or two examples of
the errors", not hundreds and hundreds of the same error, again and
again.


> I have removed segments which are proprietary and replaced with PROPRIETARY:
>
> ====================================
> BEGIN SAMPLE COMPILER LOG
> ====================================
> Makefile:53: Using kernel headers from /usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include
> <PROPRIETARY>
> <PROPRIETARY>
> In file included from /usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:15,
>                  from /usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/list.h:9,
>                  from /usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/module.h:9,
>                  from <PROPRIETARY>:41:
> /usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/printk.h:145:24: error: expected declaration specifiers or ‘...’ before numeric constant
>  static inline __printf(1, 2) __cold
>                         ^

This suggests that your proprietary headers are defining a macro
called "__print" which interferes with the use of that name in the
kernel headers.



> /usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h: In function ‘do_exit’:
> /usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:279:31: error: expected declaration specifiers before ‘__noreturn’
>  void do_exit(long error_code) __noreturn;
>                                ^~~~~~~~~~

This suggests that something has done #undef __noreturn, or you have
edited the file <linux/compiler_attributes.h> (or maybe put another
file with the same name in the include path, and so the correct one is
not being found).


> /usr/src/kernels/4.18.0-240.15.1.el8_3.x86_64/include/linux/kernel.h:322:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_kstrtoul’
>  int __must_check _kstrtoul(const char *s, unsigned int base, unsigned long *res);
>                   ^~~~~~~~~

Similarly here, for __must_check.

I think this is a problem in your proprietary driver headers, not a
problem with GCC.

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

end of thread, other threads:[~2021-06-29 11:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-29  5:17 Seeking advice on source of compilation errors in kernel header files Vinod P
2021-06-29  5:27 ` Jonathan Wakely
2021-06-29  6:29   ` Vinod P
2021-06-29 11:18     ` Jonathan Wakely

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 read-only IMAP folder(s) and NNTP newsgroup(s).