compiling patiencediff_c extension produce warnings

John Arbash Meinel john at arbash-meinel.com
Fri Feb 22 20:23:27 GMT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alexander Belchenko wrote:
| using official bzr-1.2.tar.gz I have this:
|
| $ python setup.py build_ext
| running build_ext
| ...
| building 'bzrlib._patiencediff_c' extension
| gcc -pthread -fno-strict-aliasing -DNDEBUG -O3 -march=i586 -mcpu=c3
| -fPIC -I/usr/include/python2.4 -c bzrlib/_patiencediff_c.c -o
| build/temp.linux-i686-2.4/bzrlib/_patiencediff_c.o
| In file included from /usr/include/python2.4/Python.h:8,
|                  from bzrlib/_patiencediff_c.c:28:
| /usr/include/python2.4/pyconfig.h:851:1: warning: "_POSIX_C_SOURCE"
| redefined
| In file included from /usr/include/stdlib.h:25,
|                  from bzrlib/_patiencediff_c.c:26:
| /usr/include/features.h:190:1: warning: this is the location of the
| previous definition
| gcc -pthread -shared build/temp.linux-i686-2.4/bzrlib/_patiencediff_c.o
| -o build/lib.linux-i686-2.4/bzrlib/_patiencediff_c.so
|
|

You might try something like this:

=== modified file 'bzrlib/_patiencediff_c.c'
- --- bzrlib/_patiencediff_c.c    2007-12-19 15:40:04 +0000
+++ bzrlib/_patiencediff_c.c    2008-02-22 20:21:39 +0000
@@ -23,9 +23,9 @@
~ */


+#include <Python.h>
~ #include <stdlib.h>
~ #include <string.h>
- -#include <Python.h>


~ /* http://www.python.org/dev/peps/pep-0353/ */

IIRC, Python.h always defines _POSIX_C_SOURCE because it changes how some things
are compiled. And as such it wants to be the first include.

In the past, I've also hacked it to do:

#ifndef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE ....
#endif

Otherwise, it is a known issue with Python.h, and isn't specific to
patience_diff_c.c

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHvy8/JdeBCYSNAAMRArftAJ9uAQBu/04omKcdiJaYlX0rQbBnbQCgiSMS
2WPjS8X/JNeOzBWgB80FAF8=
=T9DW
-----END PGP SIGNATURE-----



More information about the bazaar mailing list