← Back to team overview

kicad-developers team mailing list archive

Re: Exception specifiers deprecated in c++11

 

This is a patch that has a minimum amount of fixes at least.

But honestly, I can take the time to fix up my previous patch a bit, and get rid of all of the exception specifiers, there are waaay to many warnings now and it is hard to look at the output due to that.

- Kristoffer

On 2017-06-09 02:18, Chris Pavlina wrote:
On Fri, Jun 09, 2017 at 02:03:29AM +0200, Simon Richter wrote:
Hi,

On 08.06.2017 23:56, Kristoffer Ödmark wrote:

I attached a patch where i removed all of them just to show how many of
them there are, also suggest that we remove that from the coding policy
( patch 2 ).

Would it make sense to use "noexcept" still?

"noexcept" was *added* in C++11 so it's obviously allowed in C++11.

Decent explanation about this here: http://blog.quasardb.net/when-noexcept-2/


Are there any considerations regarding becoming c++11 compatible?

We already use C++11, e.g. for range-based for and std::shared_ptr.

    Simon





_______________________________________________
Mailing list: https://launchpad.net/~kicad-developers
Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp

>From 11771aa440358d5bccfa059c522f438bbc48c16f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kristoffer=20=C3=96dmark?= <kristoffer.odmark90@xxxxxxxxx>
Date: Fri, 9 Jun 2017 10:37:13 +0200
Subject: [PATCH] Cpp11 compability steps.

-Changed coding style to not have exception specifications.
-Changed autogenerated Lexer code to not have exception specifications.
---
 CMakeModules/TokenList2DsnLexer.cmake            | 6 +++---
 Documentation/development/coding-style-policy.md | 8 ++++----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/CMakeModules/TokenList2DsnLexer.cmake b/CMakeModules/TokenList2DsnLexer.cmake
index d11bc5c74..589ac0c49 100644
--- a/CMakeModules/TokenList2DsnLexer.cmake
+++ b/CMakeModules/TokenList2DsnLexer.cmake
@@ -298,7 +298,7 @@ public:
      * @return ${enum}::T - the type of token found next.
      * @throw IO_ERROR - only if the LINE_READER throws it.
      */
-    ${enum}::T NextTok() throw( IO_ERROR )
+    ${enum}::T NextTok()
     {
         return (${enum}::T) DSNLEXER::NextTok();
     }
@@ -311,7 +311,7 @@ public:
      * @return int - the actual token read in.
      * @throw IO_ERROR, if the next token does not satisfy IsSymbol()
      */
-    ${enum}::T NeedSYMBOL() throw( IO_ERROR )
+    ${enum}::T NeedSYMBOL()
     {
         return (${enum}::T) DSNLEXER::NeedSYMBOL();
     }
@@ -324,7 +324,7 @@ public:
      * @return int - the actual token read in.
      * @throw IO_ERROR, if the next token does not satisfy the above test
      */
-    ${enum}::T NeedSYMBOLorNUMBER() throw( IO_ERROR )
+    ${enum}::T NeedSYMBOLorNUMBER()
     {
         return (${enum}::T) DSNLEXER::NeedSYMBOLorNUMBER();
     }
diff --git a/Documentation/development/coding-style-policy.md b/Documentation/development/coding-style-policy.md
index 3bb2db724..e941db833 100644
--- a/Documentation/development/coding-style-policy.md
+++ b/Documentation/development/coding-style-policy.md
@@ -223,7 +223,7 @@ leading sentence in the doxygen html output. The chosen format is
      * @throw IO_ERROR, if there is a problem outputting, such asisk.
      */
     int PRINTF_FUNC Print( int nestLevel,
-        const char* fmt, ... ) throw( IO_ERROR );
+        const char* fmt, ... )
 ~~~~~~~~~~~~~
 
 The “Function \<name\>” text goes on the 2nd line of the comment. The
@@ -626,7 +626,7 @@ below was taken directly from the KiCad source.
          * @return int - The number of bytes read, 0 at end of file.
          * @throw IOError only when a line is too long.
          */
-        int ReadLine() throw (IOError);
+        int ReadLine();
 
         operator char* ()
         {
@@ -685,7 +685,7 @@ below was taken directly from the KiCad source.
          * @return int - the number of characters output.
          * @throw IOError, if there is a problem outputting, such as a full disk.
          */
-        virtual int PRINTF_FUNC Print( int nestLevel, const char* fmt, ... ) throw( IOError ) = 0;
+        virtual int PRINTF_FUNC Print( int nestLevel, const char* fmt, ... ) = 0;
 
         /*/** */*
          * Function GetQuoteChar
@@ -771,7 +771,7 @@ below was taken directly from the KiCad source.
 
 
         //-----<OUTPUTFORMATTER>------------------------------------------------
-        int PRINTF_FUNC Print( int nestLevel, const char* fmt, ... ) throw( IOError );
+        int PRINTF_FUNC Print( int nestLevel, const char* fmt, ... );
         const char* GetQuoteChar( const char* wrapee );
         //-----</OUTPUTFORMATTER>-----------------------------------------------
     };
-- 
2.13.0


Follow ups

References