Opened 11 years ago

Closed 11 years ago

#3515 closed bug (fixed)

r29382 GCC4 build broken because of string terminated on next line on l2cap_signal.cpp

Reported by: iFrodo Owned by: oruizdorantes
Priority: high Milestone: R1
Component: Network & Internet/Bluetooth Version: R1/pre-alpha1
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

When compiling the following warning/errors appears:

src/add-ons/kernel/network/protocols/l2cap/l2cap_signal.cpp:726:10: warning: missing terminating " character
src/add-ons/kernel/network/protocols/l2cap/l2cap_signal.cpp:727:30: warning: missing terminating " character
src/add-ons/kernel/network/protocols/l2cap/l2cap_signal.cpp:1090:1: error: unterminated argument list invoking macro "debugf"

After a quick investigation, it appears that it's because the string is terminated on the next line:

Line 726:

debugf("unexpected L2CAP_DisconnectReq. Channel IDs does not match, 
channel: scid=%d, dcid=%d, request: scid=%d, dcid=%d\n", ch->scid, ch->dcid, scid, dcid);

and the comma at the end of the first line makes the compile think it's the start of ne next argument (I think).

A quick fix is to either not line break, or but a \ at the end of the first line so that the compiler understand that it continues on the next line.

Example:

debugf("unexpected L2CAP_DisconnectReq. Channel IDs does not match, \
channel: scid=%d, dcid=%d, request: scid=%d, dcid=%d\n", ch->scid, ch->dcid, scid, dcid);

Both solutions have been tested and they work fine.

Change History (4)

comment:1 by iFrodo, 11 years ago

Component: - GeneralDrivers/Bluetooth
Owner: changed from axeld to oruizdorantes

comment:2 by oruizdorantes, 11 years ago

Priority: normalhigh

Thanks iFrodo for investigation, Sorry that I dont test with GCC4 I will commit a fix as soon as I get home

comment:3 by stippi, 11 years ago

Fixed in hrev29383.

comment:4 by korli, 11 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.