cppIncludeGuard icon indicating copy to clipboard operation
cppIncludeGuard copied to clipboard

BUG: etime.h never included, with filename macro

Open fiveseven-lambda opened this issue 2 years ago • 0 comments

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.

fiveseven-lambda avatar Aug 22 '23 10:08 fiveseven-lambda