This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug string/20736] New: string2.h strcmp macro gratuitously adds __builtin_

            Bug ID: 20736
           Summary: string2.h strcmp macro gratuitously adds __builtin_
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: string
          Assignee: unassigned at sourceware dot org
          Reporter: acsawdey at gcc dot
                CC: sjmunroe at us dot
  Target Milestone: ---

In string/bits/string2.h the macro defined for strcmp(s1, s2) expands to calls
to __builtin_strcmp. The analogous macro for strncmp expands to calls to

This becomes an issue if the user specifies -fno-builtin-strcmp to gcc which
now does not work because the macro has transformed strcmp to __builtin_strcmp.
The behavior with gcc is as expected with strncmp and also (for example)

Actually since strncmp calls strcmp instead if one arg is a const string
shorter than n, in that case the user's attempt to disable builtin expansion
will also not work.

If strcmp expanded in terms of strcmp not __builtin_strcmp, this could be

You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]