Skip to content
This repository was archived by the owner on Jan 4, 2023. It is now read-only.

Comments

fix compilation with clang#280

Merged
pktiuk merged 1 commit intoAntiMicro:masterfrom
magiruuvelvet:clang
Sep 15, 2021
Merged

fix compilation with clang#280
pktiuk merged 1 commit intoAntiMicro:masterfrom
magiruuvelvet:clang

Conversation

@magiruuvelvet
Copy link
Contributor

This patch addresses a compilation problem where a
pointer is compared with greater than sign ?
clang doesn't like that and throws an error, while gcc
silently shallows this.

I figured this doesn't make any sense and that
perhaps you mean to check if the pointer is not nullptr?

error: ordered comparison between pointer and zero ('QMap<SDL_JoystickID, InputDevice *> *'
      (aka 'QMap<int, InputDevice *> *') and 'int')
    if (joysticks > 0)
        ~~~~~~~~~ ^ ~
1 error generated.

After some testing I didn't noticed any changes in
the behavior of the application and it continues working
as before, just like when compiled with gcc.

This patch addresses a compilation problem where a
pointer is compared with greater than sign ?
clang doesn't like that and throws an error, while gcc
silently shallows this.

I figured this doesn't make any sense and that
perhaps you mean to check if the pointer is not `nullptr`?

```cpp
error: ordered comparison between pointer and zero ('QMap<SDL_JoystickID, InputDevice *> *'
      (aka 'QMap<int, InputDevice *> *') and 'int')
    if (joysticks > 0)
        ~~~~~~~~~ ^ ~
1 error generated.
```

After some testing I didn't noticed any changes in
the behavior of the application and it continues working
as before, just like when compiled with gcc.
@pktiuk pktiuk merged commit 008f1b9 into AntiMicro:master Sep 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants