Skip to content

Instantly share code, notes, and snippets.

@trini
Created January 17, 2024 17:04
Show Gist options
  • Save trini/a9fec05a1010611f287661e58b17cbd0 to your computer and use it in GitHub Desktop.
Save trini/a9fec05a1010611f287661e58b17cbd0 to your computer and use it in GitHub Desktop.
gcc/cpp vs llvm cpp
$ cat bad_defconfig
# CONFIG_WATCHDOG_AUTOSTART is not set
$ gcc -E -nostdinc -undef -x assembler-with-cpp bad_defconfig -o generated_defconfig
$ cat generated_defconfig
# 0 "bad_defconfig"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "bad_defconfig"
# CONFIG_WATCHDOG_AUTOSTART is not set
$ clang-16 -E -nostdinc -undef -x assembler-with-cpp bad_defconfig -o generated_defconfig
$ cat generated_defconfig
# 1 "bad_defconfig"
# 1 "<built-in>" 1
# 1 "bad_defconfig" 2
# CONFIG_WATCHDOG_AUTOSTART is not set
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment