Thread: Re: [Plib-devel] New release (Was: puAuxList.cxx) (Page 2)
Brought to you by:
sjbaker
From: Bram S. <br...@sa...> - 2006-01-06 12:58:16
|
Erik Hofman wrote: > > It might be a good idea to fix this first: > > Running automake > src/js/Makefile.am:4: UL_BSD does not appear in AM_CONDITIONAL that Makefile.am makes no sense to me: it refers to jsBSDCal.c which is not in CVS. Because it wants to build this calibration program (apparently BSD-only?) the Makefile.am is screwed. I say: remove the bin_PROGRAMS alltogether, as well as the test on UL_BSD which cannot be done in Makefile.am without a conditional. PLIB platform defines are in C++, not in autoconf-speak. Bram > > Erik > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log > files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click > _______________________________________________ > plib-devel mailing list > pli...@li... > https://lists.sourceforge.net/lists/listinfo/plib-devel |
From: Jean-Yves L. <jyl...@Fr...> - 2006-01-06 14:02:18
|
On Fri, 06 Jan 2006 13:59:06 +0100 Bram Stolk <br...@sa...> wrote: > Erik Hofman wrote: > >=20 > > It might be a good idea to fix this first: > >=20 > > Running automake > > src/js/Makefile.am:4: UL_BSD does not appear in AM_CONDITIONAL >=20 > that Makefile.am makes no sense to me: > it refers to jsBSDCal.c which is not in CVS. The person who committed my patch forgot to add it. It can be found here: http://sourceforge.net/mailarchive/forum.php?thread_id=3D9171926&forum_id= =3D4479 > Because it wants to build this calibration program (apparently > BSD-only?) the Makefile.am is screwed. >=20 > I say: remove the bin_PROGRAMS alltogether, as well as the > test on UL_BSD which cannot be done in Makefile.am without > a conditional. >=20 > PLIB platform defines are in C++, not in autoconf-speak. cpp is not appropriate in this case, since the calibration program is useless (and does not even compile) on non-BSD. --=20 Jean-Yves Lefort jyl...@Fr... http://lefort.be.eu.org/ |
From: Bram S. <br...@sa...> - 2005-12-07 09:23:34
|
steve wrote: > Bram Stolk wrote: > >> Update of /cvsroot/plib/plib/src/ssg >> In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8823 >> >> Modified Files: >> ssgLoadAC.cxx Log Message: >> Avoid append flag. Fix by Mathias > > > - loader_fd = fopen ( filename, "ra" ) ; > + loader_fd = fopen ( filename, "r" ) ; > > > Wooaaahhhhhh. > > That's not right! > > The 'a' flag only means 'append' if it's the first character > in the mode string. In the second position, it should be > ignored. On some systems, an 'a' in the second position > means "ASCII" (as opposed to 'b' for binary). > > I'm sceptical about this patch. Well... I'll be happy to reverse it, but I tried to find information about this "ra" mode. I can't find it on the net, nor on linux ia32, linux ia64, irix, freebsd manpages. They only speak of the 'b' suffix, which is normally ignored. Also, I assume ac is an ascii file, and if on those "some systems" it is read as binary, surely there is no harm in that? What happens if you read a file as binary, when in fact it's ascii? Bam > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log > files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click > _______________________________________________ > plib-devel mailing list > pli...@li... > https://lists.sourceforge.net/lists/listinfo/plib-devel -- Bram Stolk, VR Engineer SARA, Amsterdam. tel +31 20 592 3000 "Windows is a 32-bit extension to a 16-bit graphical shell for an 8-bit operating system originally coded for a 4-bit microprocessor by a 2-bit company that can't stand 1 bit of competition." |
From: steve <sjb...@ai...> - 2005-12-07 13:39:23
|
Bram Stolk wrote: > steve wrote: > >>Bram Stolk wrote: >> >> >>>Update of /cvsroot/plib/plib/src/ssg >>>In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8823 >>> >>>Modified Files: >>> ssgLoadAC.cxx Log Message: >>>Avoid append flag. Fix by Mathias >> >> >>- loader_fd = fopen ( filename, "ra" ) ; >>+ loader_fd = fopen ( filename, "r" ) ; >> >> >>Wooaaahhhhhh. >> >>That's not right! >> >>The 'a' flag only means 'append' if it's the first character >>in the mode string. In the second position, it should be >>ignored. On some systems, an 'a' in the second position >>means "ASCII" (as opposed to 'b' for binary). >> >>I'm sceptical about this patch. > > > Well... I'll be happy to reverse it, but I tried to find > information about this "ra" mode. Well, exactly - not many OS's use it. What I'm sceptical about is how (if at all) it fixes anything. Mainly though, the commit comment "Avoid append flag" shows a misunderstanding of what "ra" means. It DOES NOT MEAN 'Append'. That would be "a" by itself. So if this patch was intended to fix something - then the person doing the fixing didn't understand what they were doing - and we should be sceptical about whether this is indeed the correct patch. > I can't find it on the > net, nor on linux ia32, linux ia64, irix, freebsd manpages. "ra" is something I've seen in very ancient IBM systems where the underlying computer used EBCIDIC instead of ASCII and this flag was used to convert ASCII to EBCIDIC behind the scenes. But nobody runs PLIB on those machines (if indeed any of them still exist)! So I guess that the 'a' at the end of the string was a mistaken attempt to be the opposite of a 'b' at the end - and so this probably *is* an error - but one that should be 100% benign. So I'm left wondering why someone thought this fixed a bug - and I'm guessing that whatever they did wasn't necessarily correct and that we should look more carefully and inquire as to what was intended to be fixed. > Also, I assume ac is an ascii file Yes, it is. > and if on those "some > systems" it is read as binary, surely there is no harm in > that? What happens if you read a file as binary, when in > fact it's ascii? * Under Linux/UNIX/BSD - nothing bad happens. A file is just a file. There are no 'ASCII files' and 'Binary files'. * Under Windows - any \r\n pairs come through unchanged instead of being turned into simple \n as you'd expect when reading ASCII. However, programs that run portably ought to be prepared for the occasional spurious '\r' because files written under Windows but read under Linux/UNIX would have any \r's that got stuffed into the file by Windows come out literally just as they would under Windows if you accidentally opened an ASCII file as binary. Hence well-written, portable programs shouldn't care whether a file opened for reading is accidentally opened as binary incorrectly. The reverse is not the case however - if you open as ASCII when it's really a binary file then 'Very Bad Things' happen. * Under MacOS-9 - I believe that any \r's in the file get read as \r instead of being turned into \n's. That *might* be a bad thing - even for well-written portable programs because they are expecting '\n' to terminate a line and they'll never see a '\n' because the underlying file has a '\r' in it and without the ASCII translation mode turned on those '\r's come out as written. * Under MaxOSX - I'm not sure...probably the same as MacOS-9 and earlier. Very ikky for portable programming. Moral of the story: UNIX had it right. Abandon all other OS's immediately! |
From: Frederic B. <fre...@fr...> - 2005-12-07 13:53:53
|
Quoting steve : > Bram Stolk wrote: > > steve wrote: > > > >>Bram Stolk wrote: > >> > >> > >>>Update of /cvsroot/plib/plib/src/ssg > >>>In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8823 > >>> > >>>Modified Files: > >>> ssgLoadAC.cxx Log Message: > >>>Avoid append flag. Fix by Mathias > >> > >> > >>- loader_fd =3D fopen ( filename, "ra" ) ; > >>+ loader_fd =3D fopen ( filename, "r" ) ; > >> > >> > >>Wooaaahhhhhh. > >> > >>That's not right! > >> > >>The 'a' flag only means 'append' if it's the first character > >>in the mode string. In the second position, it should be > >>ignored. On some systems, an 'a' in the second position > >>means "ASCII" (as opposed to 'b' for binary). > >> > >>I'm sceptical about this patch. > > > > > > Well... I'll be happy to reverse it, but I tried to find > > information about this "ra" mode. > > Well, exactly - not many OS's use it. What I'm sceptical > about is how (if at all) it fixes anything. Mainly though, > the commit comment "Avoid append flag" shows a misunderstanding > of what "ra" means. It DOES NOT MEAN 'Append'. That would be > "a" by itself. Visual C++ 2005 Express generate an exception when meeting the "a" at the= second position, as it consider it as an invalid option. Reading the fopen man page from Tru64 Unix, it is stated that "+" should = be used for updating. So the right way to open an ascii file in update mode is "r+" not "ra". > > So if this patch was intended to fix something - then the > person doing the fixing didn't understand what they were > doing - and we should be sceptical about whether this is > indeed the correct patch. -Fred |
From: Bram S. <br...@sa...> - 2005-12-07 14:36:18
|
steve wrote: > So I'm left wondering why someone thought this fixed a bug - > and I'm guessing that whatever they did wasn't necessarily > correct and that we should look more carefully and inquire > as to what was intended to be fixed. Ok, I'll be more careful next time, but a crash of flightgear was reported on this list, in this posting: http://sourceforge.net/mailarchive/forum.php?thread_id=9160195&forum_id=4479 Can you live with the current "r" mode, or do you want "ra" back in? As you said, the 'a' was probably a mistake by a PDP-7 programmer who retired in the 90s :-) Bram -- Bram Stolk, VR Engineer SARA, Amsterdam. tel +31 20 592 3000 "Windows is a 32-bit extension to a 16-bit graphical shell for an 8-bit operating system originally coded for a 4-bit microprocessor by a 2-bit company that can't stand 1 bit of competition." |
From: Frederic B. <fre...@fr...> - 2005-12-07 14:46:47
|
Quoting Bram Stolk <br...@sa...>: > steve wrote: > > > So I'm left wondering why someone thought this fixed a bug - > > and I'm guessing that whatever they did wasn't necessarily > > correct and that we should look more carefully and inquire > > as to what was intended to be fixed. > > Ok, I'll be more careful next time, but a crash of flightgear > was reported on this list, in this posting: The crash is real. It is Visual C++ 2005 that throws exceptions on invali= d options. There are other strangeness that might appears logical at the seconf thou= ght. For example, strchr returns a 'const char *' in VC2005 although standard = C says that strchr should returns a char *. So loaders that do ( from memory ) : const char *filename; char *pt =3D strchr( filename, "/" ); *pt =3D '\0'; must be rewritten to add a const_cast statement. -Fred |
From: steve <sjb...@ai...> - 2005-12-07 22:31:18
|
Bram Stolk wrote: > steve wrote: > > >>So I'm left wondering why someone thought this fixed a bug - >>and I'm guessing that whatever they did wasn't necessarily >>correct and that we should look more carefully and inquire >>as to what was intended to be fixed. > > > Ok, I'll be more careful next time, but a crash of flightgear > was reported on this list, in this posting: > > http://sourceforge.net/mailarchive/forum.php?thread_id=9160195&forum_id=4479 > > Can you live with the current "r" mode, or do you want "ra" back > in? Oh - no - I'm sure that just 'r' is fine. I'm just suprised that this fixed anything. > As you said, the 'a' was probably a mistake by a PDP-7 programmer > who retired in the 90s :-) Hey - be careful... I programmed a PDP-7 once. |
From: Andy R. <an...@pl...> - 2005-12-07 15:09:46
|
steve wrote: > Mainly though, the commit comment "Avoid append flag" shows a > misunderstanding of what "ra" means. It DOES NOT MEAN > 'Append'. It does, actually. Or at least so say SUSv2 and MSDN: http://www.opengroup.org/onlinepubs/007908799/xsh/fopen.html http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_fopen.2c_._wfopen.asp The issue I think you're trying to explain is that it's not a modifier -- you specify *either* "r" or "a" (or "w"), not both. Neither spec defines a meaning for a second "a", and both are silent as to what the meaning of extra undefined characters. What was the purpose behind "ra" in the first place? Andy |