On 11/7/19 8:47 AM, Segher Boessenkool wrote:
    > Hi!
    >
    > On Wed, Nov 06, 2019 at 06:21:33PM +0100, Egeyar Bagcioglu wrote:
    >> gcc/testsuite/ChangeLog:
    >> 2019-11-06  Egeyar Bagcioglu  <egeyar.bagcio...@oracle.com>
    >>
    >>          * lib/target-supports-dg.exp: Define 
dg-require-target-object-format.
    > * lib/target-supports-dg.exp (dg-require-target-object-format): New.
    
    Right, thanks for the correction!
    
    >> +proc dg-require-target-object-format { args } {
    >> +    if { [gcc_target_object_format] == [lindex $args 1] } {
    >> +        return
    >> +    }
    > "==" for strings is dangerous.  Use "eq" or "string equal"?
    
    I see many "string match"es. I will make the change.
    
    Just as a note, though: Why is it dangerous? In C, for example, this
    would be a pointer comparison and consistently fail. In many other
    languages, it is indeed a string comparison and works well.
    
    I am asking also because I see "==" for variable vs literal strings in
    gcc/testsuite/lib. As opposed to C-like languages that consistently
    fail them, these seem to work. If you still think this is dangerous,
    I'd love to know why. Also, if so, someone might want to check the
    library.

Because if the string happens to look like a number Tcl will perform
arithmetic comparison instead of lexicographic comparison, i.e. "01" ==
"1" evaluates to true :)

Reply via email to