Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build issue #30

Closed
wants to merge 1 commit into from
Closed

Fix build issue #30

wants to merge 1 commit into from

Conversation

Urgau
Copy link

@Urgau Urgau commented Nov 15, 2018

Fix build issue on Archlinux with gcc 8.2.0

Fix build issue on Archlinux with gcc 8.2.0
@Urgau
Copy link
Author

Urgau commented Jan 25, 2019

Can this pull request be merged ?

@mutability
Copy link

What's the error this fixes?

@Urgau
Copy link
Author

Urgau commented Jan 25, 2019

I don't remember the exact message but it was a message like this: you cannot not move callsign to mm->callsign with the size of mm->callsign.

I just retry this on my new machine with gcc 8.2.0 and I don't get this error any more.

@mutability
Copy link

Ok. If you see it again, reopen this & let me know the exact error. Both callsign and mm->callsign are declared as char[9] so I can't see an obvious reason for this.

@mutability mutability closed this Jan 25, 2019
@Urgau
Copy link
Author

Urgau commented Feb 20, 2019

Here is the error:

In file included from /usr/include/string.h:494,
from dump1090.h:66,
from comm_b.c:21:
Dans la fonction « memcpy »,
mis en ligne depuis « decodeBDS20.part.2 » à comm_b.c:228:9,
mis en ligne depuis « decodeBDS20 » à comm_b.c:194:12:
/usr/include/bits/string_fortified.h:34:10: error: « __builtin_memcpy » forme le décalage [10, 16] qui est hors des limites [0, 9] de l'objet « callsign » avec le type « char[9] » [-Werror=array-bounds]
return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
comm_b.c: Dans la fonction « decodeBDS20 »:
comm_b.c:195:10: note: « callsign » déclaré ici
char callsign[9];
^~~~~~~~
cc1 : tous les avertissements sont traités comme des erreurs

Sorry for the french

@mutability
Copy link

This has got to be a compiler bug, none of the arrays involved have a size of 16 bytes. Not much I can do about compiler bugs, sorry :( Maybe you can report it upstream?

@mutability
Copy link

mutability commented Feb 20, 2019

FWIW I cannot reproduce this with
gcc version 8.2.0 (Ubuntu 8.2.0-1ubuntu2~18.04)
even with -D_FORTIFY_SOURCE=2 -fstack-protector-strong set.
(Also tried all the different values of -Wstringop-overflow with no luck)

@Urgau
Copy link
Author

Urgau commented Feb 21, 2019

To be precise I now use "gcc (GCC) 8.2.1 20181127" on Archlinux in a armv7 device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants