From 017969b193a135cd3bb63d5704bd11b62449f34e Mon Sep 17 00:00:00 2001 From: Julian Taylor Date: Thu, 9 Oct 2014 19:15:13 +0200 Subject: [PATCH] BUG: remove static from function to avoid gcc-4.1 miscompile gcc 4.1.2 (e.g. in red hat 5) will miscompile the function when inlining. Without static it will not inline solving the issue. Closes gh-5163 --- numpy/core/src/multiarray/arraytypes.c.src | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/numpy/core/src/multiarray/arraytypes.c.src b/numpy/core/src/multiarray/arraytypes.c.src index d2532ccf0e10..92752be92e90 100644 --- a/numpy/core/src/multiarray/arraytypes.c.src +++ b/numpy/core/src/multiarray/arraytypes.c.src @@ -4042,8 +4042,12 @@ datetime_dtype_metadata_clone(NpyAuxData *data) /* * Initializes the c_metadata field for the _builtin_descrs DATETIME * and TIMEDELTA. + * + * must not be static, gcc 4.1.2 on redhat 5 then miscompiles this function + * see gh-5163 + * */ -static int +NPY_NO_EXPORT int initialize_builtin_datetime_metadata(void) { PyArray_DatetimeDTypeMetaData *data1, *data2;