[Asterisk-code-review] GCC12: Fixes for 16+ (asterisk[16])

Kevin Harwell asteriskteam at digium.com
Thu May 5 09:34:32 CDT 2022


Attention is currently required from: George Joseph.
Kevin Harwell has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/18529 )

Change subject: GCC12: Fixes for 16+
......................................................................


Patch Set 1:

(2 comments)

File apps/app_festival.c:

https://gerrit.asterisk.org/c/asterisk/+/18529/comment/d0ac1749_458ebc33 
PS1, Line 436: 	if (strlen(cachedir) + sizeof(MD5Hex) + 1 <= MAXFESTLEN && (usecache == -1)) {
> > Not sure this is the right fix here? Two possible problems: […]
For 1) I'm saying strlen(x) will always be at least one less (possibly more) than sizeof(x). That could be the difference in the check here being true/false when it wasn't previously. That said if MD5Hex is guaranteed to always be 32 bytes here then it may be a moot point in this scenario.


File include/asterisk/strings.h:

https://gerrit.asterisk.org/c/asterisk/+/18529/comment/5122384d_26aace90 
PS1, Line 396: 	volatile size_t sz = size;
             : 	volatile char *sp = (char *)src;
> > I _think_ this breaks ABI as this is an inline function defined in a header, so altering stuff her […]
Not sure tbh. Here's how I understand it though. The inline function is compiled into the binary at let's say location 1 through 5. Struct X exists at 6-10. Changing the inline function makes it now take locations 1-7, which then shifts everything else down and ABI is now broken.

Also, I believe "inline" is just a hint to the compiler and the compiler can ignore it if it wants to, so if what you say is true I'm not sure we can always guarantee it.



-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/18529
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: Ia081ca1bcfb329df6487c4660aaf1944309eb570
Gerrit-Change-Number: 18529
Gerrit-PatchSet: 1
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Michael Bradeen <mbradeen at sangoma.com>
Gerrit-Attention: George Joseph <gjoseph at digium.com>
Gerrit-Comment-Date: Thu, 05 May 2022 14:34:32 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: George Joseph <gjoseph at digium.com>
Comment-In-Reply-To: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220505/6c26041e/attachment.html>


More information about the asterisk-code-review mailing list