binutils 2.9.5.0.46: IEEE support is broken in binutils because of `slashpatch'

Alexander Aganichev AAganichev@hypercom.com
Mon Jun 19 23:03:00 GMT 2000


Hi Nick,

I've made the changes you suggested and attach the patch to this message.
(See attached file: dosslash.fix.diff)

--
Alexander Aganichev
Hypercom Europe Limited, Inc.
Software Engineer


                                                                                                                                
                    Nick Clifton                                                                                                
                    <nickc@cygnus        To:     AAganichev@hypercom.com                                                        
                    .com>                cc:     bug-gnu-utils@gnu.org                                                          
                                         Subject:     Re: binutils 2.9.5.0.46: IEEE support is broken in binutils because of    
                    14.06.2000           `slash patch'                                                                          
                    21:45                                                                                                       
                                                                                                                                
                                                                                                                                



Hi Alexander,

: IEEE support is broken under cygwin (I believe UNIX systems affected as
: well). The following patch fixes this issue:
: (See attached file: ieee.diff)
:
: Also I found set of ugly code like this (it all around the
: HAVE_DOS_BASED_FILE_SYSTEM define check):
:
:   filename = strrchr (file, '/');
: #ifdef HAVE_DOS_BASED_FILE_SYSTEM
:   {
:     /* We could have foo/bar\\baz, or foo\\bar, or d:bar.  */
:     char *bslash = strrchr (file, '\\');
:     if (bslash > filename)
:       filename = bslash;
:     if (filename == NULL && file[0] != '\0' && file[1] == ':')
:      filename = file + 1;
:   }
: #endif
:
: Since a filename could be NULL I suggest to replace this line
:
:     if (bslash > filename)
:
: with
:
:     if ((filename == NULL) || (bslash > filename))
:
: I'm not sure that NULL is smallest pointer for all supported compilers.

Strictly speaking, you ought to also check that bslash is not NULL,
since it is theoretically possible that filename is non-NULL but less
than 0 (in a signed address space) in which case filename would
erroneously be set to NULL.

Cheers
           Nick


-------------- next part --------------
A non-text attachment was scrubbed...
Name: dosslash.fix.diff
Type: text/x-diff
Size: 2296 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20000619/bda6c662/attachment.bin>


More information about the Binutils mailing list