This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author trent
Recipients larry, trent
Date 2012-09-18.15:32:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1347982327.53.0.4210648465.issue15965@psf.upfronthosting.co.za>
In-reply-to
Content
Easy fix, cast AT_FDCWD to (int):


% hg diff
diff -r 3a880d640981 Modules/posixmodule.c
--- a/Modules/posixmodule.c     Tue Sep 18 07:21:18 2012 +0300
+++ b/Modules/posixmodule.c     Tue Sep 18 16:04:58 2012 +0000
@@ -414,7 +414,14 @@
 
 
 #ifdef AT_FDCWD
-#define DEFAULT_DIR_FD AT_FDCWD
+/*
+ * Why the (int) cast?  Solaris 10 defines AT_FDCWD as 0xffd19553 (-3041965);
+ * without the int cast, the value gets interpreted as uint (4291925331),
+ * which doesn't play nicely with all the initializer lines in this file that
+ * look like this:
+ *      int dir_fd = DEFAULT_DIR_FD;
+ */
+#define DEFAULT_DIR_FD (int)AT_FDCWD
 #else
 #define DEFAULT_DIR_FD (-100)
 #endif


The cast is harmless on other platforms that use an actual integer (rather than a hex representation).

Any objections?
History
Date User Action Args
2012-09-18 15:32:07trentsetrecipients: + trent, larry
2012-09-18 15:32:07trentsetmessageid: <1347982327.53.0.4210648465.issue15965@psf.upfronthosting.co.za>
2012-09-18 15:32:07trentlinkissue15965 messages
2012-09-18 15:32:06trentcreate