Issue 1216: Python2.5.1 fails to compile under VC.NET2002 ( 7.0 ) (original) (raw)

Issue1216

Created on 2007-09-27 17:54 by kartlee, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (4)
msg56176 - (view) Author: Karthik Rajagopalan (kartlee) Date: 2007-09-27 17:54
Hi, We see following compiler error when 'Python2.5.1' is compiled under VC.NET 2002 ( 7.0.9466 ). This happens in 'pythoncore' project: ------ Build started: Project: pythoncore, Configuration: Release Win32 ------ Compiling... zutil.c .... .... sha512module.c \python-build\Python-2.5.1\Modules\sha512module.c(146) : error C2059: syntax error : 'bad suffix on number' \python-build\Python-2.5.1\Modules\sha512module.c(146) : error C2146: syntax error : missing ')' before identifier 'L' \python-build\Python-2.5.1\Modules\sha512module.c(146) : error C2144: syntax error : '' should be preceded by '' \python-build\Python-2.5.1\Modules\sha512module.c(146) : error C2144: syntax error : '' should be preceded by '' \python-build\Python-2.5.1\Modules\sha512module.c(146) : error C2143: syntax error : missing ')' before 'identifier' \python-build\Python-2.5.1\Modules\sha512module.c(146) : error C2059: syntax error : 'bad suffix on number' The fix for the above problem is given below where _MSC_VER is increased more than 1300 that has LL and ULL literal suffix. VC.NET2002 is a C89 compiler and it doesn't have LL and ULL support. /* VC 7.1 has them and VC 6.0 does not. VC 6.0 has a version number of 1200. Microsoft eMbedded Visual C++ 4.0 has a version number of 1201 and doesn't define these. If some compiler does not provide them, modify the #if appropriately. */ #if defined(_MSC_VER) #if _MSC_VER > 1300 #define HAVE_UINTPTR_T 1 #define HAVE_INTPTR_T 1 #else /* VC6 & eVC4 don't support the C99 LL suffix for 64-bit integer literals */ #define Py_LL(x) x##I64 #define Py_ULL(x) Py_LL(x##U) #endif /* _MSC_VER > 1300 */ #endif /* _MSC_VER */ #endif Please let me know your comments and if the fix looks rights, please incorporate in your future release. -Karthik Rajagopalan D.E.Shaw India Software Pvt Ltd
msg56357 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2007-10-12 05:47
Martin, it looks like you made some changes in rev 46064. Can you suggest anything?
msg56359 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2007-10-12 07:27
The actual change that broke that was r41672, which added the ULL suffix. r46064 fixed it for VC6 and embedded VC. Raising the minimum _MSC_VER to above 1300 is fine (VC 7.1 is 1310). I personally can't test with VS 2002 anymore, so I have to trust that it doesn't support the suffix, and that it's value of _MSC_VER is 1300.
msg56360 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2007-10-12 08:59
Thanks for the report. This is now fixed in r58430 and r584301
History
Date User Action Args
2022-04-11 14:56:27 admin set github: 45557
2007-10-12 08:59:50 loewis set status: open -> closedresolution: fixed
2007-10-12 08:59:29 loewis set messages: +
2007-10-12 07:27:58 loewis set messages: +
2007-10-12 05:47:03 nnorwitz set assignee: loewismessages: + components: + Extension Modulesnosy: + loewis, nnorwitz
2007-09-27 17:54:12 kartlee create