fuhsnn / slimcc

C11 compiler with GNU extensions for x86-64 Linux, working towards C23
MIT License
34 stars 4 forks source link

Include guard optimization: missing check for matching #ifndef#endif #1

Closed fuhsnn closed 11 months ago

fuhsnn commented 11 months ago

guarded.h

#ifndef GUARDED_H
#define GUARDED_H
FOO
#endif

#ifdef A
BAR
#endif

included like this

#include "guarded.h"
#define A
#include "guarded.h"

-E should output

FOO
BAR