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

C compiler doesn't generate warning if ternary operator is used for near and based pointers #1328

Open
jmalak opened this issue Aug 16, 2024 · 0 comments
Labels
bug C C compiler

Comments

@jmalak
Copy link
Member

jmalak commented Aug 16, 2024

Original issue was #1326 (comment).

The test code is

#include <malloc.h>

void *test(int nump)
{
    return( nump ? malloc(5) : __doalloca(5) );
}

if it is compiled with -zu option then it should report message "Pointer truncated" on ternary operator line, but no message is displayed.

@jmalak jmalak added bug C C compiler labels Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug C C compiler
Projects
None yet
Development

No branches or pull requests

1 participant