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

Suppress deprecated sprintf warnings #32

Merged
merged 4 commits into from
Oct 14, 2022

Conversation

repi
Copy link
Contributor

@repi repi commented Oct 14, 2022

Compilation started failing after what I think was some Mac Xcode or system update (new compiler likely?).

This suppress this deprecation warning that failed the build:


warning: In file included from spirv-tools/source/opt/optimizer.cpp:28:
warning: In file included from spirv-tools/source/opt/passes.h:73:
warning: spirv-tools/source/opt/scalar_replacement_pass.h:42:5: error: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Werror,-Wdeprecated-declarations]
warning:     sprintf(&name_[strlen(name_)], "%d", max_num_elements_);
warning:     ^
warning: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
warning: __deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
warning: ^
warning: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
warning:         #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
warning:

Also few misc fixes to make sure repo builds as been a while since we changed it.

Compilation started failing after what I think was some Mac Xcode or system update (new compiler likely?).

This suppress this deprecation warning that failed the build:

```

warning: In file included from spirv-tools/source/opt/optimizer.cpp:28:
warning: In file included from spirv-tools/source/opt/passes.h:73:
warning: spirv-tools/source/opt/scalar_replacement_pass.h:42:5: error: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Werror,-Wdeprecated-declarations]
warning:     sprintf(&name_[strlen(name_)], "%d", max_num_elements_);
warning:     ^
warning: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
warning: __deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
warning: ^
warning: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
warning:         #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
warning:
```
@repi repi requested a review from Jake-Shadle as a code owner October 14, 2022 18:12
@repi
Copy link
Contributor Author

repi commented Oct 14, 2022

let's do a new patch release after this is merged, as this s blocking compilation on Mac when one have latest stuffs installed which likely more in our team will run into

@repi repi changed the title Disable deprecated sprintf warnings on Mac Suppress deprecated sprintf warnings Oct 14, 2022
@mergify mergify bot merged commit 82427bb into main Oct 14, 2022
@mergify mergify bot deleted the fix-mac-deprecated-sprintf-warnings branch October 14, 2022 18:42
@repi
Copy link
Contributor Author

repi commented Oct 14, 2022

@Jake-Shadle thx! do you wanna do a patch release or should I attempt one?

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