Skip to content

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

Description

@iam-TJ

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>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions