sepfy/libpeer

Build failed when in o2 optimize level: 'strcat' accessing xxx or more bytes at offsets xxx and xxx may overlap 1 byte at offset xxx

Opened this issue · 2 comments

D:/desktop/libpeer/examples/esp32/managed_components/sepfy__libpeer/src/peer_connection.c
In function 'peer_connection_state_new',
inlined from 'peer_connection_loop' at D:/desktop/libpeer/examples/esp32/managed_components/sepfy__libpe eer/src/peer_connection.c:367:9:
D:/desktop/libpeer/examples/esp32/managed_components/sepfy__libpeer/src/peer_connection.c:309:5: error: 'strcat' accessing 20497 or more bytes at offsets 10780 and 31276 may overlap 1 byte at offset 31276 [ -Werror=restrict]
309 | strcat(pc->local_sdp.content, description);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:/desktop/libpeer/examples/esp32/managed_components/sepfy__libpeer/src/peer_connection.c:320:7: error: 'strcat' accessing 20497 or more bytes at offsets 10780 and 31276 may overlap 1 byte at offset 31276 [ -Werror=restrict]
320 | strcat(pc->local_sdp.content, description);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:/desktop/libpeer/examples/esp32/managed_components/sepfy__libpeer/src/peer_connection.c:328:7: error: 'strcat' accessing 20497 or more bytes at offsets 10780 and 31276 may overlap 1 byte at offset 31276 [ -Werror=restrict]
328 | strcat(pc->local_sdp.content, description);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:/desktop/libpeer/examples/esp32/managed_components/sepfy__libpeer/src/peer_connection.c:335:7: error: 'strcat' accessing 20497 or more bytes at offsets 10780 and 31276 may overlap 1 byte at offset 31276 [ -Werror=restrict]
335 | strcat(pc->local_sdp.content, description);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:/desktop/libpeer/examples/esp32/managed_components/sepfy__libpeer/src/peer_connection.c:345:5: error: 'strcat' accessing 20497 or more bytes at offsets 10780 and 31276 may overlap 1 byte at offset 31276 [ -Werror=restrict]
345 | strcat(pc->local_sdp.content, description);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1.exe: some warnings being treated as errors

Can you provide more details about your compilation environment? Includes IDF version. Because I haven't encountered this problem.