Skip to content

MAINT: remove outdated mingw32 fseek support#20847

Merged
charris merged 1 commit intonumpy:mainfrom
rgommers:fix-mingw-warning
Jan 18, 2022
Merged

MAINT: remove outdated mingw32 fseek support#20847
charris merged 1 commit intonumpy:mainfrom
rgommers:fix-mingw-warning

Conversation

@rgommers
Copy link
Member

_fseeki64 and _ftelli64 have been present in mingw-w64 for a long time, see mingw-w64/mingw-w64@d66350e

This fixes an annoying build warning in the SciPy Meson build:

C:\hostedtoolcache\windows\Python\3.9.9\x64\lib\site-packages\numpy\core\include/numpy/npy_common.h:185:20: warning: 'int _fseeki64(FILE*, long long int, int)' redeclared without dllimport attribute after being referenced with dll linkage
  185 | extern int __cdecl _fseeki64(FILE *, long long, int);
      |                    ^~~~~~~~~
C:\hostedtoolcache\windows\Python\3.9.9\x64\lib\site-packages\numpy\core\include/numpy/npy_common.h:186:26: warning: 'long long int _ftelli64(FILE*)' redeclared without dllimport attribute after being referenced with dll linkage
  186 | extern long long __cdecl _ftelli64(FILE *);
      |                          ^~~~~~~~~

It's only happening for Pythran extensions, because Pythran uses fseek. The cause is otherwise unrelated to Pythran though, it's npy_common.h redefining something that's in mingw-w64.

Cc @carlkl, @matthew-brett

`_fseeki64` and `_ftelli64` have been present in mingw-w64 for a long
time, see mingw-w64/mingw-w64@d66350e

This fixes an annoying build warning in the SciPy Meson build:
```
C:\hostedtoolcache\windows\Python\3.9.9\x64\lib\site-packages\numpy\core\include/numpy/npy_common.h:185:20: warning: 'int _fseeki64(FILE*, long long int, int)' redeclared without dllimport attribute after being referenced with dll linkage
  185 | extern int __cdecl _fseeki64(FILE *, long long, int);
      |                    ^~~~~~~~~
C:\hostedtoolcache\windows\Python\3.9.9\x64\lib\site-packages\numpy\core\include/numpy/npy_common.h:186:26: warning: 'long long int _ftelli64(FILE*)' redeclared without dllimport attribute after being referenced with dll linkage
  186 | extern long long __cdecl _ftelli64(FILE *);
      |                          ^~~~~~~~~
```

It's only happening for Pythran extensions, because Pythran uses `fseek`.
The cause is otherwise unrelated to Pythran though, it's `npy_common.h`
redefining something that's in mingw-w64.
@matthew-brett
Copy link
Contributor

Seems reasonable - the mingw-w64 commit is from November 2018 - so a good long time ago.

@rgommers
Copy link
Member Author

Seems reasonable - the mingw-w64 commit is from November 2018 - so a good long time ago.

That's just moving things around, it's been in the code base since before 2010. It's the most useful commit message, that's why I linked to it.

@charris charris merged commit d0b7831 into numpy:main Jan 18, 2022
@charris
Copy link
Member

charris commented Jan 18, 2022

Thanks Ralf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants