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 larry
Recipients larry, trent
Date 2012-09-18.19:18:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <reyohyaatsepk3h4ctbxa44m.1347995880065@email.android.com>
In-reply-to
Content
Lgtm. 

Trent Nelson <report@bugs.python.org> wrote:

>
>Trent Nelson added the comment:
>
>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?
>
>----------
>
>_______________________________________
>Python tracker <report@bugs.python.org>
><http://bugs.python.org/issue15965>
>_______________________________________
History
Date User Action Args
2012-09-18 19:18:09larrysetrecipients: + larry, trent
2012-09-18 19:18:09larrylinkissue15965 messages
2012-09-18 19:18:08larrycreate