Remove clang warnings

Bug #1126077 reported by Alexey Kopytov
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

Revision history for this message
Raghavendra D Prabhu (raghavendra-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 */

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

Revision history for this message
Alexey Kopytov (akopytov) wrote : Re: [Bug 1126077] Re: Remove clang warnings

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.

Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

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.

Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

Surely this is an upstream bug?

Revision history for this message
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.

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.