What is the meaning of lines starting with a hash sign and number like '# 1 "a.c"' in the gcc preprocessor output?

These lines are hints for debugging (where the code following the line actually came from)

# line-number "source-file" [flags]

Meaning of flags (space separated):

  • 1 - Start of a new file
  • 2 - Returning to previous file
  • 3 - Following text comes from a system header file (#include <> vs #include "")
  • 4 - Following text should be treated as being wrapped in an implicit extern "C" block.

These linemarkers are mentioned in man gcc for -P option.

The -P option is specifically meant to get rid of these lines for clarity:

gcc -E -P source.c

See detailed documentation (answered before).