2016-11-14 4 views
0

ubuntuに4suite.xmlをインストール中にこのエラーが発生します。私のubuntuにはharpiaをインストールしようとしていますが、カップルのパッケージは私のシステムからは抜けています。エラー:文字列リテラルではなく、フォーマット引数がありません。[-Werror = format-security]

[email protected]:~/4Suite-XML-1.0.2$ sudo python setup.py install 
running install 
running build 
running config 
running build_py 
running build_ext 
building 'Ft.Xml.Lib.cStreamWriter' extension 
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c Ft/Xml/src/StreamWriter.c -o build/temp.linux- x86_64-2.7/Ft/Xml/src/StreamWriter.o 
In file included from /usr/include/python2.7/Python.h:94:0, 
      from Ft/Xml/src/StreamWriter.c:14: 
Ft/Xml/src/StreamWriter.c: In function ‘writer_print’: 
/usr/include/python2.7/stringobject.h:91:32: error: format not a string literal and no format arguments [-Werror=format-security] 
#define PyString_AS_STRING(op) (((PyStringObject *)(op))->ob_sval) 
          ^
Ft/Xml/src/StreamWriter.c:605:15: note: in expansion of macro ‘PyString_AS_STRING’ 
fprintf(fp, PyString_AS_STRING(repr)); 
     ^


Ft/Xml/src/StreamWriter.c: In function ‘entitymap_print’: 
/usr/include/python2.7/stringobject.h:91:32: error: format not a string literal and no format arguments [-Werror=format-security] 
#define PyString_AS_STRING(op) (((PyStringObject *)(op))->ob_sval) 
          ^
Ft/Xml/src/StreamWriter.c:815:15: note: in expansion of macro ‘PyString_AS_STRING’ 
fprintf(fp, PyString_AS_STRING(repr)); 
     ^

cc1: some warnings being treated as errors 

あなたはそれを把握するために私を助けることができますか?

答えて

0

かもしれない役に立つ以下のコードを使用しようとすると:私はインストールすると

fprintf(fp, "%s", PyString_AS_STRING(repr)); 

手がかりはfprintf, error: format not a string literal and no format arguments [-Werror=format-security]How to fix this compiler error 'format not a string literal and no format arguments'からのものであり、deploying python codes

+1

で似たような状況[wxPythonの2.8.12.1](https://sourceforge.net /projects/wxpython/files/wxPython/2.8.12.1/)fedora 23 x86_64で、私は同様の問題に遭遇しました。そして、私は 'PyErr_Format(PyExc_RuntimeError、mesg);'のソースコードをPyErr_Format(PyExc_RuntimeError、 "%s"、mesg);に変更しました。それは私のために働く。 –

関連する問題