Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
12be3d4b
Commit
12be3d4b
authored
6 years ago
by
Stefan Behnel
Committed by
GitHub
6 years ago
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2839 from fortran-favors-the-old/gcc_diagnostic_pragma
Avoid GCC diagnostic pragma if GCC < 4.6
parents
bce20eb6
b511e2dd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
Cython/Utility/TypeConversion.c
Cython/Utility/TypeConversion.c
+6
-2
No files found.
Cython/Utility/TypeConversion.c
View file @
12be3d4b
...
...
@@ -710,6 +710,10 @@ static CYTHON_INLINE PyObject* {{TO_PY_FUNCTION}}({{TYPE}} value, Py_ssize_t wid
// NOTE: inlining because most arguments are constant, which collapses lots of code below
// GCC diagnostic pragmas were introduced in GCC 4.6
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
#define GCC_DIAGNOSTIC
#endif
static
CYTHON_INLINE
PyObject
*
{{
TO_PY_FUNCTION
}}({{
TYPE
}}
value
,
Py_ssize_t
width
,
char
padding_char
,
char
format_char
)
{
// simple and conservative C string allocation on the stack: each byte gives at most 3 digits, plus sign
char
digits
[
sizeof
({{
TYPE
}})
*
3
+
2
];
...
...
@@ -719,12 +723,12 @@ static CYTHON_INLINE PyObject* {{TO_PY_FUNCTION}}({{TYPE}} value, Py_ssize_t wid
Py_ssize_t
length
,
ulength
;
int
prepend_sign
,
last_one_off
;
{{
TYPE
}}
remaining
;
#ifdef
__GNUC__
#ifdef
GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
const
{{
TYPE
}}
neg_one
=
({{
TYPE
}})
-
1
,
const_zero
=
({{
TYPE
}})
0
;
#ifdef
__GNUC__
#ifdef
GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
const
int
is_unsigned
=
neg_one
>
const_zero
;
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment