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

warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only. #10629

Closed
hiifong opened this issue Jan 19, 2023 · 6 comments · Fixed by #10959
Closed

Comments

@hiifong
Copy link

hiifong commented Jan 19, 2023

install from Github source

when i run CGO_ENABLED=1 go install --tags extended github.com/gohugoio/hugo@latest command is warning.

OS: MacOS Ventura 13.1 (22C65)
Go:go1.19.5 darwin/amd64

logs

# github.com/bep/golibsass/internal/libsass
In file included from json.cpp:2:
../../go/pkg/mod/github.com/bep/golibsass@v1.1.0/internal/libsass/../../libsass_src/src/json.cpp:1289:3: warning: '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. [-Wdeprecated-declarations]
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
@Yansre
Copy link

Yansre commented Feb 12, 2023

had the same problem,
Is there a temporary solution?

@bep bep added Duplicate and removed NeedsTriage labels Feb 13, 2023
@bep bep added this to the v0.111.0 milestone Feb 13, 2023
@bep
Copy link
Member

bep commented Feb 13, 2023

I have Ventura 13.2 and this works fine for me. I have seen reports about this before, though, and I suspect this comes down to which version of the MacOS SDK you build with.

Is there a temporary solution?

We have release binaries.

@bep bep modified the milestones: v0.111.0, v0.112.0 Feb 15, 2023
@bep
Copy link
Member

bep commented Apr 7, 2023

I just hit the "update x code" on my main development Mac, which I guess means I will get this problem, which also means that I need to put a priority to fix it ...

@bep
Copy link
Member

bep commented Apr 14, 2023

I upgreaded xcode and now get this warning, but note: it's just a warning. I have inspected the 1 usage of sprintf and it's not a security issue. So, for now I suggest you ignore this warning. I will see if I can somehow fix this upstream,

~/d/g/g/hugo ❯❯❯ go install -tags extended                                         ✘ 130 master ✭
# github.com/bep/golibsass/internal/libsass
In file included from json.cpp:2:
../../../gomod_cache/github.com/bep/golibsass@v1.1.0/internal/libsass/../../libsass_src/src/json.cpp:1289:3: warning: '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. [-Wdeprecated-declarations]
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
~/d/g/g/hugo ❯❯❯ echo $?
0

@hiifong
Copy link
Author

hiifong commented Apr 14, 2023

I upgreaded xcode and now get this warning, but note: it's just a warning. I have inspected the 1 usage of sprintf and it's not a security issue. So, for now I suggest you ignore this warning. I will see if I can somehow fix this upstream,

~/d/g/g/hugo ❯❯❯ go install -tags extended                                         ✘ 130 master ✭
# github.com/bep/golibsass/internal/libsass
In file included from json.cpp:2:
../../../gomod_cache/github.com/bep/golibsass@v1.1.0/internal/libsass/../../libsass_src/src/json.cpp:1289:3: warning: '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. [-Wdeprecated-declarations]
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
~/d/g/g/hugo ❯❯❯ echo $?
0

Thank U

@bep bep modified the milestones: v0.112.0, v0.113.0 Apr 15, 2023
bep added a commit to bep/golibsass that referenced this issue May 18, 2023
To get rid of warnings on MacOS.

This should probably be patched upstream, but that project seem to be deprecated.

See gohugoio/hugo#10629
bep added a commit to bep/golibsass that referenced this issue May 18, 2023
To get rid of warnings on MacOS.

This should probably be patched upstream, but that project seem to be deprecated.

See gohugoio/hugo#10629
bep added a commit to bep/hugo that referenced this issue May 18, 2023
@github-actions
Copy link

github-actions bot commented Jun 9, 2023

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants