From: walters AT smd4d DOT wes DOT army DOT mil (Hershel Walters) Subject: Order of "Operations" bug? To: djgpp AT sun DOT soe DOT clarkson DOT edu Date: Sat, 15 Oct 94 23:34:22 CDT Hello, I have just downloaded the djgpp distribution to my PC at home, to try my hand at developing certain utilities in DOS and uploading them when finished to my UNIX account. Here is a listing of the utilities I unzipped into my directory, in the order I unzipped them, jic this would be of any relevance: djeoe112, djdev112, gcc260bn, gas23bn, bnu24bn, gpp260, dj112m1, dj112m2. I also ran the 112m1 and m2 batch files after the installation. I then proceded to code a utility after doing some initial tests. The utility (now written as .c) is a simple matcher program which allows one to specify a marker as a special character (the marker is not matched, but instead denotes a location inside the variable to be matched). The int "marker" then is the index of the mark upon a successful match. Eg, matching "My utility" against the wildcard "y u~t" (~ being the marker denoter) results in a successful match, and results in the int marker being set to 3. Thus, I have a function which sets a variable as a side effect of a successful run (the match function itself returns the index of the last character of the last word checked when matching). Anyway, I ran a loop in the main() section which, after getting 2 test strings to match (a and b), sets marker to 0, and executes the following command: printf("Match results: Match at %d marker at %d\n",match(a,b),marker); This resulted in... Match results: Match at 5 marker at 0 ...being put on the screen after a certain test is run, where the marker _SHOULD_ be nonzero. After staring at my code trying to debug it, I tried the following revision: printf("Match results: Match at %d ",match(a,b)); printf("marker at %d\n",marker); This resulted in the correct response: ... Match results: Match at 5 marker at 3 ...for the same test string. Which FINALLY leads to my questions: Have I done something which resulted in an invalid installation, is this a bug in the djgpp code, does my having gpp installed without libraries loaded affect the distribution, or is it not a c standard for all arguments of a function (printf in this case) to be evaluated from left to right? I apologize for being verbose, but I wished to answer all relevant questions about this mail message in this one mailing. I also have retried the tests 3-4 times both with and without that revision. Please email me with some answers... I don't regularly subscribe to this mailing list. Thanx bundles! -- "How can one insulated wire bring so much happiness?" Homer Simpson <<<<><<<><<<<><><<<<<><<<<<><< Hershel Walters, walters AT smd4d DOT wes DOT army DOT mil <<<<><<<><<<><<<><<<<><<<<<><< <> / /<> <> / At your service <<<<><><><<<><<<<<<<<><<<<<><< <|_/_ / / / / Carpe Diem <<<<><<<><<<><<<><<<<<><><><<< / |/ \__/ /_/\/ Vicksburg,MS USA <<<<><<<><<<<><><<<<<<<><><<<< Computer Scientist, CEWES-SS-A ext 3011