https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127145

Drea Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2026-10-30
         Depends on|                            |126227
     Ever confirmed|0                           |1

--- Comment #2 from Drea Pinski <pinskia at gcc dot gnu.org> ---
Depends on PR 126227 I think.

If I rewrite the function to be:
```
struct timespec {
        long int tv_sec;
        long int tv_nsec;
};
int compare1(const void *a_, const void *b_) {
        const struct timespec *a = a_;
        const struct timespec *b = b_;

        int greater;
        int less;

        greater = (a->tv_sec > b->tv_sec);
        less    = (a->tv_sec < b->tv_sec);
    int tmp = greater - less;

        greater = (a->tv_nsec > b->tv_nsec);
        less    = (a->tv_nsec < b->tv_nsec);
    tmp = tmp ? tmp : (greater - less);
        return tmp;
}
```

Then spaceship operator is not detected also.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126227
[Bug 126227] `(inta > int b) - (inta < intb)` should be recongized as a
shipship operator

Reply via email to