You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Compilation of ioping v0.7 is broken under FreeBSD with follow error:
--
ioping.c:579:17: warning: implicit declaration of function 'fdatasync' is
invalid in C99 [-Wimplicit-function-declaration]
if (!cached && fdatasync(fd) < 0)
^
2 warnings generated.
/tmp/ioping-QYo1BH.o: In function `do_pwrite':
ioping.c:(.text+0xb16): undefined reference to `fdatasync'
--
cause there no fdatasync functions. fsync(2) must be used instead.
Also, CLANG out the warning about incompatible format for VERSION variable:
--
ioping.c:225:33: warning: format specifies type 'char *' but the argument has
type 'double' [-Wformat]
fprintf(stderr, "ioping %s\n", VERSION);
~~ ^~~~~~~
%f
<command line>:1:17: note: expanded from here
#define VERSION 0.7
^~~
--
Ive don't know what is correct solution to fix this:
-- fprintf(stderr, "ioping %f\n", VERSION);
++ fprintf(stderr, "ioping %f\n", VERSION);
or
-- #define VERSION 0.7
++ #define VERSION "0.7"
or (char *)VERSION
Temporary ive apply %f type for fprintf.
Please review attached patch.
Original issue reported on code.google.com by oleg.gin...@nevosoft.ru on 23 Jul 2013 at 12:18
FreeBSD really still doesn't have fdatasync? Try patch from git.
VERSION came from Makefile where it's defined as string contant:
-DVERSION=\"${VERSION}\"
So probably this doesn't work with your 'make'. Please try normal gnu make.
On Wednesday 24 July 2013 19:04:15 you wrote:
Thanks, patch works for me.
I'm not sure that the root of problem in "not gnu" make, as it is the compiler
generates a warning. A short example on MacOSX 10.8.3 Mountain Lion:
mac-builder$ cat test.c
#include <stdio.h>
#define TEST 0.1
int main()
{
printf("%s",TEST);
}
mac-builder$ cc test.c
test.c:8:10: warning: format specifies type 'char *' but the argument has type
'double' [-Wformat]
printf("%s",TEST);
~^ ~~~~
%f
1 warning generated.
mac-builder$ cc -v
Apple clang version 4.0 (tags/Apple/clang-421.0.60) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin12.3.0
Thread model: posix
Original comment by oleg.gin...@nevosoft.ru on 24 Jul 2013 at 8:10
Original issue reported on code.google.com by
oleg.gin...@nevosoft.ru
on 23 Jul 2013 at 12:18Attachments:
The text was updated successfully, but these errors were encountered: