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: implicit declaration of function ‘asprintf’; #33

Open
iam-TJ opened this issue Aug 17, 2018 · 0 comments
Open

warning: implicit declaration of function ‘asprintf’; #33

iam-TJ opened this issue Aug 17, 2018 · 0 comments

Comments

@iam-TJ
Copy link

iam-TJ commented Aug 17, 2018

On Ubuntu 18.04 compiling reports:

pgdbf.c: In function ‘main’:
pgdbf.c:571:16: warning: implicit declaration of function ‘asprintf’; did you mean ‘vsprintf’? [-Wimplicit-function-declaration]
             if(asprintf(&pgfields[fieldnum].formatstring, "%%.%dlf", fields[fieldnum].decimals) < 0) {
                ^~~~~~~~
                vsprintf

The man-page details the need to set a feature test macro:

       #define _GNU_SOURCE         /* See feature_test_macros(7) */
       #include <stdio.h>
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