[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bugs-dist
Subject:    [calligracommon] [Bug 326243] New: libs/kotext/styles/KoCharacterStyle.cpp:1938:42: warning: iterati
From:       Dennis Schridde <devurandom () gmx ! net>
Date:       2013-10-18 22:38:56
Message-ID: bug-326243-17878 () http ! bugs ! kde ! org/
[Download RAW message or body]

https://bugs.kde.org/show_bug.cgi?id=326243

            Bug ID: 326243
           Summary: libs/kotext/styles/KoCharacterStyle.cpp:1938:42:
                    warning: iteration 3u invokes undefined behavior
    Classification: Unclassified
           Product: calligracommon
           Version: 2.7.4
          Platform: Gentoo Packages
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: calligra-bugs-null@kde.org
          Reporter: devurandom@gmx.net

GCC 4.8 says:
---
calligra-2.7.4/libs/kotext/styles/KoCharacterStyle.cpp:1938:42: warning:
iteration 3u invokes undefined behavior [-Waggressive-loop-optimizations]
---

The code is:
---
    for (unsigned int i = 0; i < sizeof(keepProperties); ++i) {
        if (hasProperty(keepProperties[i])) {
            keep.insert(keepProperties[i], value(keepProperties[i]));
---

It should be: i < sizeof(keepProperties)/sizeof(*keepProperties)

Reproducible: Always

-- 
You are receiving this mail because:
You are watching all bug changes.
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic