Remove clang warnings

Bug #1126077 reported by Alexey Kopytov on 2013-02-15
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Fix Released
Low
Alexey Kopytov
5.1
Won't Fix
Undecided
Unassigned
5.5
Fix Released
Low
Alexey Kopytov

Bug Description

When building PS 5.5 with clang I get numerous warnings like this one:

/Users/kaa/src/launchpad/percona-server/5.5/Percona-Server/storage/innobase/handler/i_s.cc:172:33: note:
      expanded from macro 'STRUCT_FLD'
#define STRUCT_FLD(name, value) name: value
                                ^
/Users/kaa/src/launchpad/percona-server/5.5/Percona-Server/storage/innobase/handler/i_s.cc:7595:13: warning:
      use of GNU old-style field designator extension [-Wgnu-designator]
        STRUCT_FLD(system_vars, NULL),

The fix is:

@@ -168,7 +168,7 @@
  } \
 } while (0)

-#if !defined __STRICT_ANSI__ && defined __GNUC__ && (__GNUC__) > 2 && !defined __INTEL_COMPILER
+#if !defined __STRICT_ANSI__ && defined __GNUC__ && (__GNUC__) > 2 && !defined __INTEL_COMPILER && !defined __clang__
 #define STRUCT_FLD(name, value) name: value
 #else
 #define STRUCT_FLD(name, value) value

Related branches

I would also add (if possible) another ifdef around following pragma:

/home/raghavendra/repo/percona-server/5.5/Percona-Server/sql/item_xmlfunc.h +25:9: warning: unknown pragma ignored [-Wunknown-pragmas]
#pragma interface /* gcc class implementation */

This is how it looks currently:

#ifdef __GNUC__
#pragma interface /* gcc class implementation */
#endif

it can be made

#ifdef __GNUC__ && !defined __clang__
#pragma interface /* gcc class implementation */
#endif

Hi Raghavendra,

On Sat, 16 Feb 2013 14:09:30 -0000, Raghavendra D Prabhu wrote:
> I would also add (if possible) another ifdef around following pragma:
>
> /home/raghavendra/repo/percona-server/5.5/Percona-Server/sql/item_xmlfunc.h +25:9: warning: unknown pragma ignored [-Wunknown-pragmas]
> #pragma interface /* gcc class implementation */
>
>

Yes, I see other warnings with clang, but those are not as frequent and
annoying as this one.

The fix for this one has already been merged, so other warnigns should
be reported as separate bugs.

They were not frequent, however I did see 10-15 times (or may be more, didn't count) during the compilation of the code, will report it as a separate bug.

Surely this is an upstream bug?

Alexey Kopytov (akopytov) wrote :

On Mon, 18 Feb 2013 04:56:54 -0000, Laurynas Biveinis wrote:
> Surely this is an upstream bug?
>

Yes, fixed in 5.6 upstream. No bug references in commit comments.

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-1968

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers