◐ Shell
clean mode source ↗

Issue #21: Avoid C++ keyword `module` by erlend-aasland · Pull Request #22 · python/pythoncapi-compat

@erlend-aasland

Rename module variable/argument names as mod.

Fixes #21

corona10

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with easy solution but let's wait @vstinner 's review

@vstinner

Is it possible to detect the error using a C++ compiler warning to prevent adding new ones? The C++ compatibility is tested in tests/.

@erlend-aasland

Is it possible to detect the error using a C++ compiler warning to prevent adding new ones? The C++ compatibility is tested in tests/.

Good point. I'll add a test.

@vstinner

I guess that this PR is related to: https://bugs.python.org/issue39355

I don't get any warning:

$ cat x.cc 
int main() { int module = 1; return module; }
$ g++ -std=c++20 -Wall -Wextra x.cc -o x
# no warning

@vstinner

@vstinner

Thanks, I merged your fix!

@erlend-aasland

vstinner added a commit to vstinner/pythoncapi_compat that referenced this pull request

Mar 29, 2022

vstinner added a commit that referenced this pull request

Mar 29, 2022