]> git.ipfire.org Git - thirdparty/elfutils.git/commit
libcpu: Include config.h before standard headers in lexer source
authorMichael Pratt <mcpratt@pm.me>
Thu, 10 Oct 2024 10:27:02 +0000 (10:27 +0000)
committerMark Wielaard <mark@klomp.org>
Mon, 14 Oct 2024 20:38:52 +0000 (22:38 +0200)
commit7f06ac2b3fc0077f29bcc68064ca8e91fa7cd080
tree43a2f9249b3d0c43ff545d2621c8f52860a6d6e6
parentc981e61aa301d389f18df5fd279c1ca4d39d38a0
libcpu: Include config.h before standard headers in lexer source

As part of the processing of flex, definitions and headers
are added to output source before any literal text or generated code.

This causes standard headers to come before config.h
unless config.h is included in a %top block instead
as specified in the flex manual, section 5.1 "Format of the Definitions".

The %top block is non-POSIX, so using it reinforces
the requirement of "flex" over a standardized "lex" even more.

      * libcpu/i386_lex.l (%top): add flex %top block
      and move config.h header inclusion to it.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
libcpu/i386_lex.l