darkfeline / cantata

Automatically exported from code.google.com/p/cantata
GNU General Public License v3.0
0 stars 0 forks source link

Need for _POSIX_C_SOURCE in replaygain/ffmpeginput.cpp and replaygain/mpg123input.cpp #629

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Which version of Cantata?
cantata-1.5.1

Which build? KDE, Qt4, Qt5, Windows, Ubuntu, Mac?
QT5, FreeBSD

What steps will reproduce the problem?
1. compile (qt5)-cantata with replaygain
2.
3.

What is the expected output? What do you see instead?
Build fails with:
[...]
[ 98%] Building CXX object 
replaygain/CMakeFiles/cantata-replaygain.dir/ffmpeginput.cpp.o
In file included from 
/storage/ports/svnports/audio/cantata/work/cantata-1.5.1/replaygain/ffmpeginput.
cpp:31:
In file included from /usr/local/include/qt5/QtCore/QFile:1:
In file included from /usr/local/include/qt5/QtCore/qfile.h:45:
In file included from /usr/local/include/qt5/QtCore/qfiledevice.h:45:
In file included from /usr/local/include/qt5/QtCore/qiodevice.h:47:
In file included from /usr/local/include/qt5/QtCore/qobject.h:49:
In file included from /usr/local/include/qt5/QtCore/qstring.h:50:
In file included from /usr/include/c++/v1/string:437:
/usr/include/c++/v1/cstdio:143:9: error: no member named 'snprintf' in the 
global namespace
using ::snprintf;
      ~~^
/usr/include/c++/v1/cstdio:148:9: error: no member named 'vfscanf' in the 
global namespace; did you mean 'fscanf'?
using ::vfscanf;
      ~~^
/usr/include/stdio.h:248:6: note: 'fscanf' declared here
int      fscanf(FILE * __restrict, const char * __restrict, ...);
         ^
[...]

Please provide any additional information below.
The fix is to remove the 
#define _POSIX_C_SOURCE 1
lines from the files.

Are they needed on other platforms, and if so, is 1 the correct value?

Original issue reported on code.google.com by tcber...@gmail.com on 18 Feb 2015 at 8:59

GoogleCodeExporter commented 9 years ago
To expand here a bit, this error happens with libc++, so it may also be 
possible to reproduce it on recent OS X versions.
snprintf(3) and vfscanf(3) are part of C99, but _POSIX_C_SOURCE == 1 means 
"adhere to C89" on Linux according to feature_test_macros(7) and basically the 
same on FreeBSD as well.

Original comment by kub...@gmail.com on 18 Feb 2015 at 9:06

GoogleCodeExporter commented 9 years ago
Fixed in trunk (for 1.6.0) and branches/1.5 (for 1.5.2). I think this #define 
is a hangover from the original libebur128 routines which I converted from C to 
C++

Original comment by craig.p....@gmail.com on 19 Feb 2015 at 6:00