Bug 2155642 - qt5-qtwebengine: libsync should not build with -Wno-implicit-function-declaration -std=gnu11
Summary: qt5-qtwebengine: libsync should not build with -Wno-implicit-function-declara...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: qt5-qtwebengine
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Florian Weimer
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PortingToModernCHelpNeeded
TreeView+ depends on / blocked
 
Reported: 2022-12-21 17:33 UTC by Florian Weimer
Modified: 2023-02-23 15:28 UTC (History)
4 users (show)

Fixed In Version: qt5-qtwebengine-5.15.12-4.fc39
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-02-23 15:28:19 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
qt5-qtwebengine-c99.patch (1.62 KB, patch)
2023-02-23 11:22 UTC, Florian Weimer
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Qt Bug Tracker QTBUG-111440 0 Not Evaluated Reported C99 compatibility issue in libsync (impacts qt5-qtwebengine) 2023-02-23 11:23:21 UTC

Description Florian Weimer 2022-12-21 17:33:20 UTC
If the code has implicit function declarations, it needs to be build with -std=gnu89 because these declarations are a C89 feature.

A future compiler will likely reject this:

../../3rdparty/chromium/third_party/libsync/src/sync.c:80:5: error: implicit declaration of function 'strlcpy'
   80 |     strlcpy(data.name, name, sizeof(data.name));
      |     ^~~~~~~

In GCC, warning flags do not gate access to obsolete language constructs, so -Wno-implicit-function-declaration is unlikely to work for this. If this is old, pre-ANSI code, -std=gnu89 should work fine.

Comment 1 Florian Weimer 2022-12-21 17:35:45 UTC
Do you know where qt5-webengine/Chromium get their copy of libsync from?

Comment 2 Ben Cotton 2023-02-07 15:04:04 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 38 development cycle.
Changing version to 38.

Comment 3 Jan Grulich 2023-02-08 10:32:46 UTC
(In reply to Florian Weimer from comment #1)
> Do you know where qt5-webengine/Chromium get their copy of libsync from?

https://source.chromium.org/chromium/chromium/src/+/main:third_party/libsync/README.chromium

Comment 4 Jan Grulich 2023-02-08 10:34:39 UTC
It looks strlcpy() is an addition Chromium adds on its own.

Comment 5 Florian Weimer 2023-02-23 11:22:48 UTC
Created attachment 1945899 [details]
qt5-qtwebengine-c99.patch

This patch seems to fix it.

Comment 6 Kevin Kofler 2023-02-23 13:21:34 UTC
I think it would be cleaner to use a proper header file for strlcpy, but sure, as long as the function is only used in one .c file, this will work.

And for jgrulich: strlcpy is one of those safer string functions from BSD that glibc unfortunately refuses to add (see https://lwn.net/Articles/507319/ – more than 10 years old and yet still current) because they are not required by any standard. They can be found in libbsd, but sadly many projects prefer just copying&pasting the code over adding a small dependency, and that is what Chromium is doing here.

Comment 7 Florian Weimer 2023-02-23 15:15:27 UTC
Any further comments before i push this patch? Thanks.

Comment 8 Kevin Kofler 2023-02-23 15:22:04 UTC
Just to be clear: I'm OK with you pushing this.


Note You need to log in before you can comment on or make changes to this bug.