Fix compilation
ClosedPublic

Authored by aacid on Mar 31 2019, 7:53 PM.

Details

Summary

Seems only gcc can do a constexpr with strlen.

This fixes the build with clang, hopefully to with MSVC?

Diff Detail

Repository
R287 KImageFormats
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 10311
Build 10329: arc lint + arc unit
aacid created this revision.Mar 31 2019, 7:53 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptMar 31 2019, 7:53 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
aacid requested review of this revision.Mar 31 2019, 7:53 PM
svuorela accepted this revision.Mar 31 2019, 8:10 PM
This revision is now accepted and ready to land.Mar 31 2019, 8:10 PM
aacid closed this revision.Mar 31 2019, 8:18 PM
apol added inline comments.Apr 1 2019, 12:32 PM
src/imageformats/ora.cpp
21

Won't sizeof give the sizeof(char*)?

bruns added a subscriber: bruns.Apr 1 2019, 1:15 PM

Although s_magic decays to a char*, it is not a char*. char[n] is a type distinct from char*

From e.g. man strlen

char string[32] = "hello, world";
char *ptr = string;
sizeof (string)
    ⇒ 32
sizeof (ptr)
    ⇒ 4  /* (on a machine with 4 byte pointers) */