Project

General

Profile

Actions

Bug #5560

open

gcc 12.1.0 warns when compiling libosmosim

Added by pespin 7 days ago. Updated 7 days ago.

Status:
New
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
05/13/2022
Due date:
% Done:

0%

Spec Reference:

Description

Since gcc ugprade to 12.1.0 in my system, I get this warning (error due to using -Werror):

libosmocore/src/sim/reader.c:43:13: error: the comparison will always evaluate as 'true' for the pointer operand in 'resp->l2h + ((sizetype)((struct osim_msgb_cb *)&resp->cb[0])->lc + 5)' must not be NULL

Indeed !msgb_apdu_de(resp) makes no sense, since currently msgb_apdu_de() returns a pointer calculated with offset from first param, so it indeed can never be null
Not sure if the code in get_sw() is expected to dereference the value, or simply that use of !msgb_apdu_de(resp) doesn't make sense at all in there

PS: there's no libosmosim in "Category" in redmine when creating the ticket.

Actions #1

Updated by pespin 7 days ago

  • Description updated (diff)
Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)