Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Hej Matúš,

you don't have to be scared, just push it ;-)
here is warning fix as a seperate patch.

David

On 13.04.2012 13:39, Matúš Kukan wrote:
On 13 April 2012 12:56, David Ostrovsky<david.ostrovsky@gmx.de>  wrote:
Hi,

Here is the corrected patch.
I fixed the build error with --enable-werror option enabled.
Hmm, I would not push it together.
Warning errors are somehow related to gbuild because there are
different settings but I would push that separately.
I pushed one part as
http://cgit.freedesktop.org/libreoffice/core/commit/?id=99b04ed2be3023bec874fce529d453123f48ac99

Could you please send another patch for the other issue ?
Also I don't want to review it, because it scares me :)

Thanks,
Matus
_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

From 0116010024850c234b691766824ec3f8456011af Mon Sep 17 00:00:00 2001
From: David Ostrovsky <David.Ostrovsky@gmx.de>
Date: Fri, 13 Apr 2012 13:51:27 +0200
Subject: [PATCH] gbuild conversion: idlc module -- build warnings fixed

---
 idlc/source/parser.y        |   34 +++++++++++++++++++++++++++++-----
 idlc/source/preproc/eval.c  |   24 ++++++++++++------------
 idlc/source/wrap_parser.cxx |   32 --------------------------------
 3 files changed, 41 insertions(+), 49 deletions(-)
 delete mode 100644 idlc/source/wrap_parser.cxx

diff --git a/idlc/source/parser.y b/idlc/source/parser.y
index ec1dfc0..11f6eec 100644
--- a/idlc/source/parser.y
+++ b/idlc/source/parser.y
@@ -257,13 +257,34 @@ bool includes(AstDeclaration const * type1, AstDeclaration const * type2) {
 }
 
 // Suppress any warnings from generated code:
+// This suppression is not working after gbuild conversion
+// because parser.cxx is compiled drectly and not with wraper-stuff.
+//#if defined __GNUC__
+//#pragma GCC system_header
+//#elif defined __SUNPRO_CC
+//#pragma disable_warn
+//#elif defined _MSC_VER
+//#pragma warning(push, 1)
+//#pragma warning(disable: 4273 4701 4702 4706)
+//#endif
+
+// Suppress the warnings this way
+// borrowed from here:
+// rsc/source/parser/rscyacc.y
+#if defined _MSC_VER
+#pragma warning(push, 1)
+#pragma warning(disable:4129 4273 4701 4702)
+#endif
 #if defined __GNUC__
-#pragma GCC system_header
+#define GCC_VERSION (__GNUC__ * 10000 \
+                     + __GNUC_MINOR__ * 100 \
+                     + __GNUC_PATCHLEVEL__)
+/* Diagnostics pragma was introduced with gcc-4.2.1 */
+#if GCC_VERSION >= 40201
+#pragma GCC diagnostic ignored "-Wwrite-strings"
+#endif
 #elif defined __SUNPRO_CC
 #pragma disable_warn
-#elif defined _MSC_VER
-#pragma warning(push, 1)
-#pragma warning(disable: 4273 4701 4702 4706)
 #endif
 %}
 /*
@@ -601,7 +622,7 @@ forward_dcl :
                {
                        pForward = new AstInterface(*$1, NULL, pScope);
                        
-                       if ( pDecl = pScope->lookupByName(pForward->getScopedName()) ) 
+                       if ( (pDecl = pScope->lookupByName(pForward->getScopedName())) ) 
                        {
                                if ( (pDecl != pForward) && 
                                         (pDecl->getNodeType() == NT_interface) )
@@ -3285,6 +3306,9 @@ identifier:
     ;
 
 %%
+#if defined _MSC_VER
+#pragma warning(pop)
+#endif
 
 /*
  * Report an error situation discovered in a production
diff --git a/idlc/source/preproc/eval.c b/idlc/source/preproc/eval.c
index 9a1a620..41cc2e3 100644
--- a/idlc/source/preproc/eval.c
+++ b/idlc/source/preproc/eval.c
@@ -262,7 +262,7 @@ long
 {
     Token *tp;
     Nlist *np;
-    int ntok, rand;
+    int ntok, local_rand;
 
     trp->tp++;
     if (kw == KIFDEF || kw == KIFNDEF)
@@ -283,7 +283,7 @@ long
     vp = vals;
     op = ops;
     *op++ = END;
-    for (rand = 0, tp = trp->bp + ntok; tp < trp->lp; tp++)
+    for (local_rand = 0, tp = trp->bp + ntok; tp < trp->lp; tp++)
     {
         switch (tp->type)
         {
@@ -298,17 +298,17 @@ long
             case NUMBER:
             case CCON:
             case STRING:
-                if (rand)
+                if (local_rand)
                     goto syntax;
                 *vp++ = tokval(tp);
-                rand = 1;
+                local_rand = 1;
                 continue;
 
                 /* unary */
             case DEFINED:
             case TILDE:
             case NOT:
-                if (rand)
+                if (local_rand)
                     goto syntax;
                 *op++ = tp->type;
                 continue;
@@ -318,7 +318,7 @@ long
             case MINUS:
             case STAR:
             case AND:
-                if (rand == 0)
+                if (local_rand == 0)
                 {
                     if (tp->type == MINUS)
                         *op++ = UMINUS;
@@ -349,22 +349,22 @@ long
             case QUEST:
             case COLON:
             case COMMA:
-                if (rand == 0)
+                if (local_rand == 0)
                     goto syntax;
                 if (evalop(priority[tp->type]) != 0)
                     return 0;
                 *op++ = tp->type;
-                rand = 0;
+                local_rand = 0;
                 continue;
 
             case LP:
-                if (rand)
+                if (local_rand)
                     goto syntax;
                 *op++ = LP;
                 continue;
 
             case RP:
-                if (!rand)
+                if (!local_rand)
                     goto syntax;
                 if (evalop(priority[RP]) != 0)
                     return 0;
@@ -382,7 +382,7 @@ long
                     if (np && (np->val == KMACHINE))
                     {
                         tp++;
-                        if (rand)
+                        if (local_rand)
                             goto syntax;
                         *op++ = ARCHITECTURE;
                         continue;
@@ -395,7 +395,7 @@ long
                 return 0;
         }
     }
-    if (rand == 0)
+    if (local_rand == 0)
         goto syntax;
     if (evalop(priority[END]) != 0)
         return 0;
diff --git a/idlc/source/wrap_parser.cxx b/idlc/source/wrap_parser.cxx
deleted file mode 100644
index 053713a..0000000
--- a/idlc/source/wrap_parser.cxx
+++ /dev/null
@@ -1,32 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include "parser.cxx"
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
-- 
1.7.5.4


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.