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

Implicit declaration of function 'vsnprintf' #55

Open
Kerl13 opened this issue Nov 29, 2020 · 2 comments
Open

Implicit declaration of function 'vsnprintf' #55

Kerl13 opened this issue Nov 29, 2020 · 2 comments
Assignees
Labels

Comments

@Kerl13
Copy link

Kerl13 commented Nov 29, 2020

When compiling the argtable3.c file produced by tools/build dist (as of fe70fd5) with gcc version 10.2.0, I get the following warning:

$ cc --version
cc (GCC) 10.2.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ cc -Wall -Wextra -pedantic -ansi -c argtable3.c
argtable3.c: In function 'arg_dstr_catf':
argtable3.c:1104:13: warning: implicit declaration of function 'vsnprintf'; did you mean 'vsprintf'? [-Wimplicit-function-declaration]
 1104 |         r = vsnprintf(buff, n + 1, fmt, arglist);
      |             ^~~~~~~~~
      |             vsprintf

From the man page, vsnprintf seems to only be available starting from C99

Kerl13 added a commit to Kerl13/randdag that referenced this issue Nov 29, 2020
@tomghuang tomghuang self-assigned this Nov 29, 2020
@tomghuang
Copy link
Contributor

tomghuang commented Nov 29, 2020

@Kerl13 , you're right, vsnprintf seems to be a new C standard function. Would you mind providing a patch, so that it can work in older compilers? Thanks.

@Kerl13
Copy link
Author

Kerl13 commented Nov 29, 2020

I can look into this!
But maybe not before one week or two when I have more time

@tomghuang tomghuang added the bug label Nov 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants