Bug 448378

Summary: Compilation failure due to "expected unqualified-id before numeric constant"
Product: [Applications] Discover Reporter: Bart Ribbers <bribbers>
Component: KNewStuff BackendAssignee: Dan Leinir Turthra Jensen <leinir>
Status: RESOLVED FIXED    
Severity: normal CC: aleixpol, nate
Priority: NOR    
Version First Reported In: 5.23.90   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 5.24.0
Sentry Crash Report:

Description Bart Ribbers 2022-01-13 17:57:11 UTC
SUMMARY

In file included from /usr/include/limits.h:40,
                 from /usr/include/fortify/stdlib.h:29,
                 from /usr/include/c++/11.2.1/cstdlib:75,
                 from /usr/include/c++/11.2.1/bits/stl_algo.h:59,
                 from /usr/include/c++/11.2.1/algorithm:62,
                 from /usr/include/qt5/QtCore/qglobal.h:142,
                 from /usr/include/qt5/QtCore/qalgorithms.h:43,
                 from /usr/include/qt5/QtCore/qdebug.h:44,
                 from /usr/include/qt5/QtCore/QDebug:1,
                 from /home/bart/Documents/Git/alpine/aports/community/discover/src/discover-5.23.90/libdiscover/backends/KNSBackend/KNSBackend.cpp:8:
/home/bart/Documents/Git/alpine/aports/community/discover/src/discover-5.23.90/libdiscover/backends/KNSBackend/KNSBackend.cpp:39:18: error: expected unqualified-id before numeric constant
   39 | static const int PAGE_SIZE = 100;
      |                  ^~~~~~~~~

STEPS TO REPRODUCE
1. Compile Discover 5.23.90 with the KNSBackend enabled

OBSERVED RESULT
Compilation fails with above mentioned error

EXPECTED RESULT
Compilation to succeed

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Alpine Linux 
(available in About System)
KDE Plasma Version: 5.23.90
KDE Frameworks Version: 5.90
Qt Version: 5.15.3 (KDE patches)
Comment 1 Heiko Becker 2022-01-14 11:39:24 UTC
Git commit cdb3e43205c0eec83e7987c08bc26b1da32b8da3 by Heiko Becker.
Committed on 14/01/2022 at 10:06.
Pushed by apol into branch 'master'.

Rename PAGE_SIZE to ENGINE_PAGE_SIZE to avoid a clash

Fixes the build with musl libc because it clashes with PAGE_SIZE
from limits.h, which according to POSIX [1] should be in there.
Fails with "KNSBackend.cpp:39:18: error: expected unqualified-id
before numeric constant
   39 | static const int PAGE_SIZE = 100;" otherwise.
FIXED-IN: 5.24.0

[1] https://pubs.opengroup.org/onlinepubs/009696899/basedefs/limits.h.html

M  +3    -3    libdiscover/backends/KNSBackend/KNSBackend.cpp

https://invent.kde.org/plasma/discover/commit/cdb3e43205c0eec83e7987c08bc26b1da32b8da3
Comment 2 Aleix Pol 2022-01-14 11:39:55 UTC
Git commit 9a49983081c7258a5eafc1abdfae64eb765587c8 by Aleix Pol Gonzalez, on behalf of Heiko Becker.
Committed on 14/01/2022 at 11:39.
Pushed by apol into branch 'Plasma/5.24'.

Rename PAGE_SIZE to ENGINE_PAGE_SIZE to avoid a clash

Fixes the build with musl libc because it clashes with PAGE_SIZE
from limits.h, which according to POSIX [1] should be in there.
Fails with "KNSBackend.cpp:39:18: error: expected unqualified-id
before numeric constant
   39 | static const int PAGE_SIZE = 100;" otherwise.
FIXED-IN: 5.24.0

[1] https://pubs.opengroup.org/onlinepubs/009696899/basedefs/limits.h.html


(cherry picked from commit cdb3e43205c0eec83e7987c08bc26b1da32b8da3)

M  +3    -3    libdiscover/backends/KNSBackend/KNSBackend.cpp

https://invent.kde.org/plasma/discover/commit/9a49983081c7258a5eafc1abdfae64eb765587c8