anti-globbing not working in 0.90.1

Windows specific questions.
nedman47
Posts: 62
Joined: Dec 05, 2006 15:35

anti-globbing not working in 0.90.1

Postby nedman47 » Aug 11, 2013 16:07

I started a new project and thought i would try compiling with with 0.90.1 instead of 0.24. i quickly found that COMMAND emits a list of file names in response to input of *. a bug?

extern _crt_glob alias "_crt_glob" as integer
dim shared _crt_glob as integer = 0
print command
dkl
Site Admin
Posts: 3211
Joined: Jul 28, 2005 14:45
Location: Germany

Re: anti-globbing not working in 0.90.1

Postby dkl » Aug 11, 2013 20:06

I used MinGW-w64 instead of MinGW.org for 0.90, and MinGW-w64 for some reason uses a different global variable to do this:

Code: Select all

extern _dowildcard alias "_dowildcard" as long
dim shared _dowildcard as long = 0

print command( )
DOS386
Posts: 798
Joined: Jul 02, 2005 20:55

Re: anti-globbing not working in 0.90.1

Postby DOS386 » Aug 22, 2013 6:59

counting_pine
Site Admin
Posts: 6199
Joined: Jul 05, 2005 17:32
Location: Manchester, Lancs

Re: anti-globbing not working in 0.90.1

Postby counting_pine » Aug 22, 2013 17:14

Should we unify on Integer/Long in those two code snippets?
dkl
Site Admin
Posts: 3211
Joined: Jul 28, 2005 14:45
Location: Germany

Re: anti-globbing not working in 0.90.1

Postby dkl » Oct 01, 2013 20:56

I think these global variables are 32bit ints, even in 64bit MinGW-w64, so we should definitely use 32bit Longs on the FB side, considering that Integer would become 64bit in 64bit FB.

I'm hoping we could go back to using MinGW.org for the "official" FB-win32 build - the only reason to switch away was GCC v4 which MinGW.org didn't have, but now they're up to date, and binary size issues which I think are solved by [0537df1d]/[16032c1d]. That would change the way to do globbing back to how it was before (unless MinGW.org changed it too in the meantime).

Of course for a future FB-win64 build, which would have to use MinGW-w64 (at least while there is no 64bit MinGW.org), the way to disable globbing would then still be different from FB-win32.

Perhaps we should add an fbc command line option or similar to control the globbing behaviour, and let FB take care of interfacing with the MinGW toolchain?
counting_pine
Site Admin
Posts: 6199
Joined: Jul 05, 2005 17:32
Location: Manchester, Lancs

Re: anti-globbing not working in 0.90.1

Postby counting_pine » Oct 02, 2013 20:58

Yeah, this seems like a good thing to have some cross-platform support for where possible. Would it work for DOS too?
A command-line option sounds like a good idea, though I don't know whether a source-level solution would be better from the programmer's perspective. That would allow the preprocessor some control, e.g. for compiling in older versions.

Return to “Windows”

Who is online

Users browsing this forum: No registered users and 3 guests