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

SDL_assert_always broken if SDL_ASSERT_LEVEL==0 #7433

Closed
sezero opened this issue Mar 9, 2023 · 3 comments
Closed

SDL_assert_always broken if SDL_ASSERT_LEVEL==0 #7433

sezero opened this issue Mar 9, 2023 · 3 comments

Comments

@sezero
Copy link
Contributor

sezero commented Mar 9, 2023

Because SDL_enabled_assert macro and SDL_ReportAssertion function are
guarded by #if (SDL_ASSERT_LEVEL > 0) -- Is that really intended?

#include "SDL_assert.h"
void foo (int x) {
    SDL_assert_always(x>0);
}
$ gcc -DSDL_ASSERT_LEVEL=0 -Wall -c 1.c 
1.c: In function ‘foo’:
1.c:3: warning: implicit declaration of function 'SDL_enabled_assert'
@slouken
Copy link
Collaborator

slouken commented Mar 9, 2023

No, they shouldn't be guarded by #if (SDL_ASSERT_LEVEL > 0)

@sezero
Copy link
Contributor Author

sezero commented Mar 9, 2023

I will remove that guard in main, also in SDL2 and release-2.26.x branches.

OK?

@slouken
Copy link
Collaborator

slouken commented Mar 9, 2023

Yes, sounds good.

@sezero sezero closed this as completed in bb59f46 Mar 9, 2023
sezero added a commit that referenced this issue Mar 9, 2023
Otherwise, SDL_assert_always() wouldn't work.

Fixes #7433
sezero added a commit that referenced this issue Mar 9, 2023
Otherwise, SDL_assert_always() wouldn't work.

Fixes #7433
sezero added a commit to sezero/SDL that referenced this issue Mar 10, 2023
Otherwise, SDL_assert_always() wouldn't work.

Fixes libsdl-org#7433
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

No branches or pull requests

2 participants