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

clang warnings #74

Closed
polluks opened this issue Jul 31, 2023 · 2 comments
Closed

clang warnings #74

polluks opened this issue Jul 31, 2023 · 2 comments
Assignees

Comments

@polluks
Copy link
Contributor

polluks commented Jul 31, 2023

Compile src/compiler/os.cc
src/compiler/os.cc:130:28: warning: suggest braces around initialization of subobject [-Wmissing-braces]
    struct sigaction sa = {SIG_IGN, 0}, oldint, oldquit;
                           ^~~~~~~
                           {      }
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/signal.h:132:25: note: expanded from macro 'SIG_IGN'
#define SIG_IGN         (void (*)(int))1
                        ^~~~~~~~~~~~~~~~
src/compiler/os.cc:144:32: warning: suggest braces around initialization of subobject [-Wmissing-braces]
        struct sigaction sa = {SIG_DFL, 0};
                               ^~~~~~~
                               {      }
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/signal.h:131:25: note: expanded from macro 'SIG_DFL'
#define SIG_DFL         (void (*)(int))0
                        ^~~~~~~~~~~~~~~~
2 warnings generated.
@dmsc
Copy link
Owner

dmsc commented Jul 31, 2023

Hi!

This does not warn in Linux because it has a more correct definition, with the parentheses:

#define SIG_DFL	((__sighandler_t)0)

Can you test if writing SIG_IGN with parentheses outside woks?

struct sigaction sa = {(SIG_IGN), 0}, oldint, oldquit;

If it removes the warning, I can apply it as a fix.

Have Fun!

@dmsc dmsc self-assigned this Jul 31, 2023
@dmsc
Copy link
Owner

dmsc commented Apr 23, 2024

Closing, no reply on a year.

@dmsc dmsc closed this as completed Apr 23, 2024
polluks pushed a commit to polluks/fastbasic that referenced this issue Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants