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

NULL is not recognized as sentinel #253

Open
JayFoxRox opened this issue Dec 16, 2019 · 2 comments
Open

NULL is not recognized as sentinel #253

JayFoxRox opened this issue Dec 16, 2019 · 2 comments
Labels
upstream issue Issues that track upstream problems

Comments

@JayFoxRox
Copy link
Member

JayFoxRox commented Dec 16, 2019

Our NULL doesn't appear to be detected as sentinel. This leads to confusing output like this:

neverball/share/gui.c:708:51: warning: missing sentinel in function call [-Wsentinel]
    return concat_string("...", text + right, NULL);
                                                  ^
                                                  , NULL
neverball/share/common.h:74:7: note: function has been explicitly marked sentinel here
char *concat_string(const char *first, ...) NULL_TERMINATED;

Looking at my local /usr/lib/clang/9.0.0/include/stddef.h it looks like we should be using #define NULL __null (C++) and #define NULL ((void*)0) (C)? What are we using? Why doesn't it work?

@thrimbor
Copy link
Member

Our NULL comes from PDCLib, which defines it as _PDCLIB_NULL, which is defined in _PDCLIB_int.h: #define _PDCLIB_NULL 0

The C standard says the following about NULL: [...] which expands to an implementation-defined null pointer constant [...]

So I'd say this is a shortcoming of upstream PDCLib. This indicates that an integer literal zero is fine on Windows, but not for clang.

@thrimbor thrimbor added the upstream issue Issues that track upstream problems label Nov 30, 2020
@JayFoxRox
Copy link
Member Author

This seems to have been fixed upstream, did we ever update afterwards = is this possibly fixed now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream issue Issues that track upstream problems
Development

No branches or pull requests

2 participants