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

error: function may return address of local variable #38

Open
alopatindev opened this issue Jun 28, 2018 · 0 comments
Open

error: function may return address of local variable #38

alopatindev opened this issue Jun 28, 2018 · 0 comments

Comments

@alopatindev
Copy link

$ CFLAGS="-fstack-protector-strong -O2" cmake . && make -j8
...
src/ngp_search.c: In function ‘get_file_name’:
cc1: error: function may return address of local variable [-Werror=return-local-addr]
src/ngp_search.c:60:10: note: declared here
     char copy[FILENAME_MAX];

I'd also enable other warnings to see more potential issues
-pedantic-errors -pedantic -Wextra -Wall
For some weird reason it disables the local variable issue for me.

I'm using gcc 6.4.0 on Gentoo GNU/Linux.
Thank you!

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

No branches or pull requests

1 participant