summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-01-31 12:29:46 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2018-01-31 21:03:22 +0100
commitb7c5ddcdd05ceba73acb1a298500892d6157f360 (patch)
tree03a7e22462bb653cb38bb0b747c72bbe1e81636f
parentbridges: MSVC: pragma warning: make more specific, remove obsolete (diff)
downloadcore-b7c5ddcdd05ceba73acb1a298500892d6157f360.tar.gz
core-b7c5ddcdd05ceba73acb1a298500892d6157f360.zip
connectivity: MSVC: pragma warning: make more specific, remove obsolete
Change-Id: I22553d7cbbae7cfaac3f39a17db54dfe06e2e5bc Reviewed-on: https://gerrit.libreoffice.org/48989 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r--connectivity/source/drivers/firebird/Connection.cxx12
-rw-r--r--connectivity/source/drivers/mork/post_include_windows.h24
-rw-r--r--connectivity/source/drivers/mork/pre_include_windows.h25
-rw-r--r--connectivity/source/inc/ado/Aolevariant.hxx2
-rw-r--r--connectivity/source/inc/ado/Awrapado.hxx2
-rw-r--r--connectivity/source/inc/ado/Awrapadox.hxx2
-rw-r--r--connectivity/source/inc/ado/WrapColumn.hxx2
-rw-r--r--connectivity/source/inc/ado/ado_post_sys_include.h26
-rw-r--r--connectivity/source/inc/ado/ado_pre_sys_include.h33
-rw-r--r--connectivity/source/inc/ado/adoimp.hxx2
-rw-r--r--connectivity/source/parse/sqlbison.y13
-rw-r--r--connectivity/source/parse/sqlflex.l14
-rw-r--r--include/connectivity/odbc.hxx9
13 files changed, 23 insertions, 143 deletions
diff --git a/connectivity/source/drivers/firebird/Connection.cxx b/connectivity/source/drivers/firebird/Connection.cxx
index 619f324720e9..9cb9fc340cc8 100644
--- a/connectivity/source/drivers/firebird/Connection.cxx
+++ b/connectivity/source/drivers/firebird/Connection.cxx
@@ -55,11 +55,6 @@
#include <rtl/strbuf.hxx>
-#ifdef _WIN32
-// for ADD_SPB_NUMERIC
-#pragma warning(disable: 4310) // cast truncates data
-#endif
-
using namespace connectivity::firebird;
using namespace connectivity;
@@ -637,7 +632,14 @@ void Connection::runBackupService(const short nAction)
aRequest.append(char(isc_spb_options)); // 4-Byte bitmask
char sOptions[4];
char * pOptions = sOptions;
+#ifdef _WIN32
+#pragma warning(push)
+#pragma warning(disable: 4310) // cast truncates data
+#endif
ADD_SPB_NUMERIC(pOptions, isc_spb_res_create);
+#ifdef _WIN32
+#pragma warning(pop)
+#endif
aRequest.append(sOptions, 4);
}
diff --git a/connectivity/source/drivers/mork/post_include_windows.h b/connectivity/source/drivers/mork/post_include_windows.h
deleted file mode 100644
index bd49753b7bd7..000000000000
--- a/connectivity/source/drivers/mork/post_include_windows.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifdef _MSC_VER
- #pragma warning(pop)
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mork/pre_include_windows.h b/connectivity/source/drivers/mork/pre_include_windows.h
deleted file mode 100644
index 7d68ce298f9e..000000000000
--- a/connectivity/source/drivers/mork/pre_include_windows.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifdef _MSC_VER
- #pragma warning(push,1)
- #pragma warning(disable:4668 4917)
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/Aolevariant.hxx b/connectivity/source/inc/ado/Aolevariant.hxx
index a9af47ee042e..732880a7c088 100644
--- a/connectivity/source/inc/ado/Aolevariant.hxx
+++ b/connectivity/source/inc/ado/Aolevariant.hxx
@@ -23,9 +23,7 @@
#include <rtl/ustring.hxx>
#include <com/sun/star/uno/Sequence.hxx>
-#include <ado/ado_pre_sys_include.h>
#include <oaidl.h>
-#include <ado/ado_post_sys_include.h>
namespace com
{
diff --git a/connectivity/source/inc/ado/Awrapado.hxx b/connectivity/source/inc/ado/Awrapado.hxx
index f8b6d818f6d7..c7817a75b326 100644
--- a/connectivity/source/inc/ado/Awrapado.hxx
+++ b/connectivity/source/inc/ado/Awrapado.hxx
@@ -22,11 +22,9 @@
#include <com/sun/star/beans/PropertyAttribute.hpp>
// Includes for ADO
-#include <ado/ado_pre_sys_include.h>
#include <oledb.h>
#include <ocidl.h>
#include <adoint.h>
-#include <ado/ado_post_sys_include.h>
#include <ado/adoimp.hxx>
#include <ado/Aolewrap.hxx>
#include <ado/Aolevariant.hxx>
diff --git a/connectivity/source/inc/ado/Awrapadox.hxx b/connectivity/source/inc/ado/Awrapadox.hxx
index 83374761ac9b..ea32f5895464 100644
--- a/connectivity/source/inc/ado/Awrapadox.hxx
+++ b/connectivity/source/inc/ado/Awrapadox.hxx
@@ -53,10 +53,8 @@ typedef struct _ADOTable Table;
#endif
-#include <ado/ado_pre_sys_include.h>
#include <adoint.h>
#include <adoctint.h>
-#include <ado/ado_post_sys_include.h>
#include <ado/Aolewrap.hxx>
diff --git a/connectivity/source/inc/ado/WrapColumn.hxx b/connectivity/source/inc/ado/WrapColumn.hxx
index fd50fee44287..7f3dd3d86903 100644
--- a/connectivity/source/inc/ado/WrapColumn.hxx
+++ b/connectivity/source/inc/ado/WrapColumn.hxx
@@ -21,9 +21,7 @@
#include <ado/Aolewrap.hxx>
-#include <ado/ado_pre_sys_include.h>
#include <adoint.h>
-#include <ado/ado_post_sys_include.h>
namespace connectivity
{
diff --git a/connectivity/source/inc/ado/ado_post_sys_include.h b/connectivity/source/inc/ado/ado_post_sys_include.h
deleted file mode 100644
index ee808f82e109..000000000000
--- a/connectivity/source/inc/ado/ado_post_sys_include.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#undef ADO_REDUCED_WARN_LEVEL
-
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/ado_pre_sys_include.h b/connectivity/source/inc/ado/ado_pre_sys_include.h
deleted file mode 100644
index 70f77a708cf6..000000000000
--- a/connectivity/source/inc/ado/ado_pre_sys_include.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifdef ADO_REDUCED_WARN_LEVEL
- #error "ado_pre_sys_include.h included twice!"
-#endif
-
-#ifdef _MSC_VER
-#pragma warning(push,1)
-#pragma warning(disable:4917)
-#endif
-
-#include <sdkddkver.h>
-
-#define ADO_REDUCED_WARN_LEVEL
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/ado/adoimp.hxx b/connectivity/source/inc/ado/adoimp.hxx
index a0ab03e369ee..8393ca731aa3 100644
--- a/connectivity/source/inc/ado/adoimp.hxx
+++ b/connectivity/source/inc/ado/adoimp.hxx
@@ -21,9 +21,7 @@
#include <com/sun/star/sdbc/SQLException.hpp>
-#include <ado/ado_pre_sys_include.h>
#include <adoctint.h>
-#include <ado/ado_post_sys_include.h>
struct ADOConnection;
namespace connectivity
diff --git a/connectivity/source/parse/sqlbison.y b/connectivity/source/parse/sqlbison.y
index 0f21bcc6fcc9..dbf203f814a1 100644
--- a/connectivity/source/parse/sqlbison.y
+++ b/connectivity/source/parse/sqlbison.y
@@ -47,8 +47,10 @@
#include <sal/macros.h>
#if defined _MSC_VER
-#pragma warning(push, 1)
-#pragma warning(disable:4273 4701)
+#pragma warning(push)
+#pragma warning(disable: 4324) // structure was padded due to alignment specifier
+#pragma warning(disable: 4065) // switch statement contains 'default' but no 'case' labels
+#pragma warning(disable: 4702) // unreachable code
#endif
#ifdef __GNUC__
@@ -4260,6 +4262,9 @@ trigger_name:
;
%%
+#if defined _MSC_VER
+#pragma warning(pop)
+#endif
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::beans;
@@ -4818,7 +4823,3 @@ int OSQLParser::SQLlex()
{
return OSQLScanner::SQLlex();
}
-
-#if defined _MSC_VER
-#pragma warning(pop)
-#endif
diff --git a/connectivity/source/parse/sqlflex.l b/connectivity/source/parse/sqlflex.l
index 9bbf3d173b67..54f253651447 100644
--- a/connectivity/source/parse/sqlflex.l
+++ b/connectivity/source/parse/sqlflex.l
@@ -28,7 +28,16 @@
#include <string.h>
+#if defined _MSC_VER
+#pragma warning ( push )
+// Silence warnings about redefinition of INT8_MIN etc in stdint.h
+// The flex-generated workdir/LexTarget/idlc/source/scanner.cxx defines them prior to these includes
+#pragma warning ( disable : 4005 )
+#endif
#include <connectivity/internalnode.hxx>
+#if defined _MSC_VER
+#pragma warning(pop)
+#endif
#ifndef INCLUDED_CONNECTIVITY_SOURCE_PARSE_SQLFLEX_L
#define INCLUDED_CONNECTIVITY_SOURCE_PARSE_SQLFLEX_L
@@ -47,7 +56,6 @@
#include <connectivity/sqlscan.hxx>
#if defined _MSC_VER
-#pragma warning(push, 1)
/**/
#ifdef yywrap
#undef yywrap
@@ -793,7 +801,3 @@ sal_Int32 OSQLScanner::SQLlex()
{
return SQLyylex();
}
-
-#if defined _MSC_VER
-#pragma warning(pop)
-#endif
diff --git a/include/connectivity/odbc.hxx b/include/connectivity/odbc.hxx
index a39a426975fc..896001477293 100644
--- a/include/connectivity/odbc.hxx
+++ b/include/connectivity/odbc.hxx
@@ -23,11 +23,6 @@
#if defined(_WIN32)
-#ifdef _MSC_VER
-#pragma warning(push)
-#pragma warning(disable:4005)
-#endif
-
#include <prewin.h>
// just to go with calling convention of windows
@@ -45,10 +40,6 @@
#undef SQL_API
#define SQL_API __stdcall
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
-
#ifndef SQL_C_BOOKMARK
#define SQL_C_BOOKMARK SQL_C_ULONG /* BOOKMARK */
#endif