GCC 14 will fail to build this package with an error like this: parser-sming.y:2164:89: error: passing argument 2 of 'setAttributeList' makes pointer from integer without a cast 2164 | setAttributeList($$, $1); | ^ | | | int In file included from error.h:17, from parser-sming.y:39: data.h:703:61: note: expected 'List *' but argument is of type 'int' 703 | extern void setAttributeList(Attribute *attributePtr, List *listPtr); | ~~~~~~^~~~~~~ parser-sming.y:2165:40: error: assignment to 'List *' from 'int' makes pointer from integer without a cast 2165 | for (p = $1; p; p = p->nextPtr) | ^ This comes from the handler for the bits keyword in lib/parser-sming.y: | BitsKeyword { bitsFlag = 1; //Since Enum elements can be //negative we must make sure //that bits is not negative, //so we raise bitsFlag and //give error if there is //negative value } bitsOrEnumerationSpec { List *p; $$ = duplicateTypeToAttribute(smiHandle->typeBitsPtr, classPtr, thisParserPtr); setAttributeParentType($$, smiHandle->typeBitsPtr); if ($1) { setAttributeList($$, $1); for (p = $1; p; p = p->nextPtr) ((NamedNumber *)(p->ptr))->typePtr = (Type*)$$; } bitsFlag = 0; /* reset flag */ } I don't know how to fix this properly. The types appear to line up properly in the Bison grammar source. Reproducible: Always
Because you've been in this package before, you know how old and crufty it is. That said, I went upstream and found that they had actually been making changes over the last ... 10 years? So, I rebased the sources Fedora uses and made some cleanups that seemed obviously correct to me. It's not at all clear who (if anyone) is using libsmi in 2024. Upstream hadn't made meaningful changes in several years, so we could probably retire this package with minimal impact if we needed to (I think wireshark is the only Fedora consumer). That said, toss gcc 14 at libsmi-0.4.8-35.fc40 (current in rawhide) and see if it fails in the same way (or in other ways)?
Unfortunately, the errors are still there: parser-sming.y:2158:82: error: passing argument 2 of 'setAttributeList' makes pointer from integer without a cast 2158 | setAttributeList($$, $1); | ^ | | | int smi-data.h:705:61: note: expected 'List *' but argument is of type 'int' 705 | extern void setAttributeList(Attribute *attributePtr, List *listPtr); | ~~~~~~^~~~~~~ parser-sming.y:2159:40: error: assignment to 'List *' from 'int' makes pointer from integer without a cast 2159 | for (p = $1; p; p = p->nextPtr) | ^ parser-sming.y:2198:44: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 2198 | } else if (tmp = findClass($1, | ^~~ I suppose we can add an exemption once GCC 14 lands, but I think this is really a parser bug, leading to a crash if this syntax is ever used in the input.
As we can't rebuild this parser from source, I've downgraded the type safety level for this package.