D8327: setup: relax -Werror for declaration-after-statement on Python 3.9

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

D8327: setup: relax -Werror for declaration-after-statement on Python 3.9

martinvonz (Martin von Zweigbergk)
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  It turns out Python 3.9 introduces such declarations in the headers, eg
 
  cpython/abstract.h:189:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
 
  so we have to be more relaxed when compiling for 3.9.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8327

AFFECTED FILES
  setup.py

CHANGE DETAILS

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -1270,8 +1270,9 @@
 
 common_cflags = []
 
-# MSVC 2008 still needs declarations at the top of the scope.
-if os.name != 'nt':
+# MSVC 2008 still needs declarations at the top of the scope, but Python 3.9
+# makes declarations not at the top of a scope in the headers.
+if os.name != 'nt' and sys.version_info[1] < 9:
     common_cflags = ['-Werror=declaration-after-statement']
 
 osutil_cflags = []



To: durin42, #hg-reviewers
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

D8327: setup: relax -Werror for declaration-after-statement on Python 3.9

martinvonz (Martin von Zweigbergk)
Closed by commit rHG960770add699: setup: relax -Werror for declaration-after-statement on Python 3.9 (authored by durin42).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8327?vs=20874&id=20890

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8327/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8327

AFFECTED FILES
  setup.py

CHANGE DETAILS

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -1270,8 +1270,9 @@
 
 common_cflags = []
 
-# MSVC 2008 still needs declarations at the top of the scope.
-if os.name != 'nt':
+# MSVC 2008 still needs declarations at the top of the scope, but Python 3.9
+# makes declarations not at the top of a scope in the headers.
+if os.name != 'nt' and sys.version_info[1] < 9:
     common_cflags = ['-Werror=declaration-after-statement']
 
 osutil_cflags = []



To: durin42, #hg-reviewers, Alphare, pulkit
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel