Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't undefine __STRICT_ANSI__ for mingw #1112

Merged
merged 1 commit into from
Jun 25, 2024

Conversation

tobil4sk
Copy link
Member

@tobil4sk tobil4sk commented Jun 8, 2024

This was done originally for #785. However, since gcc 11.1.0, this gives a warning:

In file included from /usr/x86_64-w64-mingw32/include/c++/13.1.0/bits/exception.h:36,
                 from /usr/x86_64-w64-mingw32/include/c++/13.1.0/typeinfo:34,
                 from /.../hxcpp/include/hxcpp.h:27,
                 from /.../hxcpp/src/hx/Lib.cpp:1:
/usr/x86_64-w64-mingw32/include/c++/13.1.0/x86_64-w64-mingw32/bits/c++config.h:666:2: warning: #warning "__STRICT_ANSI__ seems to have been undefined; this is not supported" [-Wcpp]
  666 | #warning "__STRICT_ANSI__ seems to have been undefined; this is not supported"
      |  ^~~~~~~

This is due to this change: https://gcc.gnu.org/git/?p=gcc.git;a=commit;f=libstdc%2B%2B-v3/include/bits/c%2B%2Bconfig;h=767537a8b027bcb5807bb45b0268c5da98c2c7a0

The original problem in #785 doesn't happen with mingw-w64. The original mingw project is outdated (and 32 bit only) so it is safe remove this flag now. Compilation with the original mingw is already broken anyway:

Mingw compilation errors ``` Error: D:/hxcpp/src/hx/Thread.cpp:628:2: error: 'CONDITION_VARIABLE' does not name a type CONDITION_VARIABLE cond; ^ D:/hxcpp/src/hx/Thread.cpp: In constructor 'hxCondition::hxCondition()': D:/hxcpp/src/hx/Thread.cpp:641:31: error: 'cond' was not declared in this scope InitializeConditionVariable(&cond); ^ D:/hxcpp/src/hx/Thread.cpp:641:35: error: 'InitializeConditionVariable' was not declared in this scope InitializeConditionVariable(&cond); ^ D:/hxcpp/src/hx/Thread.cpp: In member function 'void hxCondition::Wait()': D:/hxcpp/src/hx/Thread.cpp:711:30: error: 'cond' was not declared in this scope SleepConditionVariableCS(&cond,&cs,INFINITE); ^ D:/hxcpp/src/hx/Thread.cpp:711:47: error: 'SleepConditionVariableCS' was not declared in this scope SleepConditionVariableCS(&cond,&cs,INFINITE); ^ D:/hxcpp/src/hx/Thread.cpp: In member function 'bool hxCondition::TimedWait(double)': D:/hxcpp/src/hx/Thread.cpp:721:43: error: 'cond' was not declared in this scope return (bool)SleepConditionVariableCS(&cond, &cs, (DWORD)((FLOAT)timeout * 1000.0)); ^ D:/hxcpp/src/hx/Thread.cpp:721:86: error: 'SleepConditionVariableCS' was not declared in this scope return (bool)SleepConditionVariableCS(&cond, &cs, (DWORD)((FLOAT)timeout * 1000.0)); ^ D:/hxcpp/src/hx/Thread.cpp: In member function 'void hxCondition::Signal()': D:/hxcpp/src/hx/Thread.cpp:744:27: error: 'cond' was not declared in this scope WakeConditionVariable(&cond); ^ D:/hxcpp/src/hx/Thread.cpp:744:31: error: 'WakeConditionVariable' was not declared in this scope WakeConditionVariable(&cond); ^ D:/hxcpp/src/hx/Thread.cpp: In member function 'void hxCondition::Broadcast()': D:/hxcpp/src/hx/Thread.cpp:753:30: error: 'cond' was not declared in this scope WakeAllConditionVariable(&cond); ^ D:/hxcpp/src/hx/Thread.cpp:753:34: error: 'WakeAllConditionVariable' was not declared in this scope WakeAllConditionVariable(&cond); ```

@tobil4sk tobil4sk force-pushed the fix/mingw-STRICT_ANSI-warning branch 2 times, most recently from 83042ee to f3e1b96 Compare June 25, 2024 12:06
@Simn
Copy link
Member

Simn commented Jun 25, 2024

This PR has a conflict now.

This was done originally to fix HaxeFoundation#785. However, since gcc 11.1.0, this
gives a warning:
__STRICT_ANSI__ seems to have been undefined; this is not supported

Due to this change:
https://gcc.gnu.org/git/?p=gcc.git;a=commit;f=libstdc%2B%2B-v3/include/bits/c%2B%2Bconfig;h=767537a8b027bcb5807bb45b0268c5da98c2c7a0

The original issue no longer happens with mingw-w64. The original mingw
project is outdated (and 32 bit only) it is safe remove this flag now.
@tobil4sk tobil4sk force-pushed the fix/mingw-STRICT_ANSI-warning branch from f3e1b96 to 03d5c8d Compare June 25, 2024 14:32
@tobil4sk
Copy link
Member Author

Finally green, thanks! @Simn

@Simn Simn merged commit abecbda into HaxeFoundation:master Jun 25, 2024
100 checks passed
@tobil4sk tobil4sk deleted the fix/mingw-STRICT_ANSI-warning branch June 25, 2024 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants