RE: [Dev-C++] gcc, BC++ and wildcards on Win98
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Ioannis V. <no...@ya...> - 2002-03-05 01:48:18
|
> -----Original Message-----
> From: dev...@li...=20
> [mailto:dev...@li...] On Behalf=20
> Of gi...@li...
> Sent: Sunday, March 03, 2002 6:34 PM
> To: dev...@so...
> Subject: [Dev-C++] gcc, BC++ and wildcards on Win98
>=20
>=20
> Hello list,
>=20
> A few days ago, I mailed a message about the fact that the=20
> same C code,=20
> when compiled with GNU gcc and executed generated output=20
> different from the=20
> one generated by compiling the same source code with BC++.
>=20
> The source was:
>=20
> /* echo.c */
> #include <stdio.h>
> int
> main(int argc, char **argv)
> {
> while (--argc)
> printf("%s%c", *++argv, (argc > 1) ? ' ': '\n');
> return 0;
> }
>=20
> And to produce different output I did the following:
>=20
> 1. compiled the code using the commands: (I had both=20
> compilers in my path)
> gcc -oecho_g.exe echo.c
> bcc32 -eecho_b.exe echo.c
>=20
> 2. generated different output issuing the commands:
> echo_g *.c
> echo_b *.c
>=20
> The result of the first command was what I expected: all=20
> files with a ".c"=20
> extension, found in the current directory, where listed. The=20
> result of the=20
> second command was simply the string "*.c". I was told to=20
> link the BC++=20
> compiled program against the object file "wildargs.obj",=20
> which is shipped=20
> with BC++ as an object. In fact when I generated the=20
> "echo_b.exe" using:
> bcc32 -eecho_b.exe echo.c wildargs.obj
>=20
> the output of "echo_b *.c" was the same as the one generated=20
> by echo_g.exe.
>=20
> Now here is the surprise (at least for me): if the current=20
> directory has=20
> some subdirectories, for instance you have the following items in it:
> foo.c
> bar.o
> subdir1
> subdir2
>=20
> The command: "echo_g *" will still show what I expect: the 4=20
> items. The command "echo_b *" (even if I linked against=20
> wildarags.obj) will only=20
> list the two files foo.c and bar.o, it will miss the=20
> subdirectories. Note that "dir /b *" will generate the same=20
> output as "echo_g.exe".
>=20
> In the end, IMHO, full consistency/portability across the two=20
> compilers,=20
> can't be achieved.
But you can always isolate system dependencies e.g. by using a constant.
Needless to say that i consider BC++'s default behavior as the best one.
Ioannis
=20
* Ioannis Vranos
* Programming pages: http://www.noicys.d2g.com
* Alternative URL: http://run.to/noicys
|