cppIncludeGuard
cppIncludeGuard copied to clipboard
BUG: etime.h never included, with filename macro
My project has a file named etime.h. When the 'Macro Type' is set to 'Filename', this file is never included, because the auto-generated include guard is named ETIME.
The following code reproduces the bug:
main.cpp
#include <iostream>
#include "etime.h"
int main(){
greet();
}
etime.h
#ifndef ETIME
#define ETIME
int greet(){
std::cout << "hello" << std::endl;
}
#endif /* ETIME */
Expected behavior: If the filename begins with e, avoid the macro name beginning with E by a digit or an uppercase letter (say, by inserting _ after E).
I'm using Arch Linux and gcc (GCC) 13.2.1.