aboutsummaryrefslogtreecommitdiff
path: root/nuttx-patches
diff options
context:
space:
mode:
authorDavid Sidrane <david_s5@nscdg.com>2015-02-25 08:00:18 -1000
committerDavid Sidrane <david_s5@nscdg.com>2015-04-07 07:18:46 -1000
commit3f484e4e444a9c9f76501702c5372ceec4e7cf62 (patch)
tree6aaeabe95a66a5cd3d53e802b6b138cf37ebc6ab /nuttx-patches
parent4359b84cd8af29b70e9c9570ffa2b9d106db38f0 (diff)
downloadpx4-firmware-3f484e4e444a9c9f76501702c5372ceec4e7cf62.tar.gz
px4-firmware-3f484e4e444a9c9f76501702c5372ceec4e7cf62.tar.bz2
px4-firmware-3f484e4e444a9c9f76501702c5372ceec4e7cf62.zip
Intrim DANGEROUS fix to allow the PX4 development to continue until there is a SAFE solution to foreign (non-nuttx) header file inclusion. There is a potential of a binary incompatibility and runtime errors, memory overwrites or corruption.
Diffstat (limited to 'nuttx-patches')
-rw-r--r--nuttx-patches/c++11.patch91
1 files changed, 62 insertions, 29 deletions
diff --git a/nuttx-patches/c++11.patch b/nuttx-patches/c++11.patch
index 17b3fd52f..70276aa92 100644
--- a/nuttx-patches/c++11.patch
+++ b/nuttx-patches/c++11.patch
@@ -1,20 +1,39 @@
diff --git NuttX/nuttx/include/cxx/cwchar NuttX/nuttx/include/cxx/cwchar
-index 60c261d..68a1c04 100755
+index 67716ab..bd21740 100755
--- NuttX/nuttx/include/cxx/cwchar
+++ NuttX/nuttx/include/cxx/cwchar
-@@ -46,4 +46,97 @@
+@@ -46,13 +46,115 @@
// Namespace
//***************************************************************************
-+namespace std
-+{
-+ using ::mbstate_t;
-+} // namespace std
++/* N.B. The following definitions are enabled at this time to allow the PX4
++ * development to continue until there is a SAFE solution to foreign
++ * (non-nuttx) header file inclusion. There is a potential of a binary
++ * incompatibility and runtime errors, memory overwrites or corruption
++ * VVVVVVVVVVVVVVVVVVVVVVVVVV Begin Warning VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
++ */
+ namespace std
+ {
+-#if 0 /* Not defined */
++#if __cplusplus >= 201103L
+ using ::mbstate_t;
+ #endif
++/*^^^^^^^^^^^^^^^^^^^^^^^^^ End Warning ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
+
-+/* These functions are not implemented, but listed here to allow compilation
-+* Any resulting linker error will require the implementation of the offending
-+* function(s) Code contributions are welcome.
-+*/
+ using ::wint_t;
+ using ::size_t;
+ };
+
++/* N.B. The following definitions are enabled at this time to allow the PX4
++ * development to continue until there is a SAFE solution to foreign
++ * (non-nuttx) header file inclusion. There is a potential of a binary
++ * incompatibility and runtime errors, memory overwrites or corruption
++ *
++ * These functions are not implemented, but listed here to allow compilation
++ * Any resulting linker error will require the implementation of the offending
++ * function(s) Code contributions are welcome.
++ * VVVVVVVVVVVVVVVVVVVVVVVVVV Begin Warning VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
++ */
+
+#if __cplusplus >= 201103L
+
@@ -97,21 +116,26 @@ index 60c261d..68a1c04 100755
+int vswscanf(const wchar_t *, const wchar_t *, va_list);
+int vwscanf(const wchar_t *, va_list);
+float wcstof(const wchar_t *, wchar_t **);
-+
+#endif
++/*^^^^^^^^^^^^^^^^^^^^^^^^^ End Warning ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
#endif // __INCLUDE_CXX_CWCHAR
diff --git NuttX/nuttx/include/wchar.h NuttX/nuttx/include/wchar.h
-index 54fa796..263212a 100644
+index 90e3d4f..f7dee97 100644
--- NuttX/nuttx/include/wchar.h
+++ NuttX/nuttx/include/wchar.h
-@@ -93,15 +93,31 @@
- * wctype_t
+@@ -96,7 +96,25 @@ typedef int wint_t;
+ /* wctype_t
* A scalar type of a data object that can hold values which represent
* locale-specific character classification.
- *
-- * mbstate_t
+ */
+
++/* N.B. The following definitions are enabled at this time to allow the PX4
++ * development to continue until there is a SAFE solution to foreign
++ * (non-nuttx) header file inclusion. There is a potential of a binary
++ * incompatibility and runtime errors, memory overwrites or corruption
++ * VVVVVVVVVVVVVVVVVVVVVVVVVV Begin Warning VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
++ */
+#ifndef _WCTYPE_T
+#define _WCTYPE_T
+# ifdef _AEABI_PORTABLE
@@ -120,23 +144,32 @@ index 54fa796..263212a 100644
+typedef int wctype_t;
+# endif
+#endif /* !_WCTYPE_T */
++/*^^^^^^^^^^^^^^^^^^^^^^^^^ End Warning ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
+
-+ /* mbstate_t
++/*
+ * mbstate_t
* An object type other than an array type that can hold the conversion
* state information necessary to convert between sequences of (possibly
- * multibyte) characters and wide-characters. If a codeset is being used
- * such that an mbstate_t needs to preserve more than 2 levels of reserved
+@@ -105,7 +123,13 @@ typedef int wint_t;
* state, the results are unspecified.
-- *
-- * FILE
+ */
+
+-#if 0 /* Not used */
++/* N.B. The following definitions are enabled at this time to allow the PX4
++ * development to continue until there is a SAFE solution to foreign
++ * (non-nuttx) header file inclusion. There is a potential of a binary
++ * incompatibility and runtime errors, memory overwrites or corruption
++ * VVVVVVVVVVVVVVVVVVVVVVVVVV Begin Warning VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
+ */
-+
-+typedef struct
-+{
-+ int __fill[6];
-+} mbstate_t;
-+
-+/* FILE
++#if __cplusplus >= 201103L
+ /* Commented out because this is dangerous. This defines a type that would
+ * be internal to some wchar implementation. NuttX does not implement the
+ * wchar functions. Having this definition is a time bomb: If this header
+@@ -128,6 +152,7 @@ struct mbstate_s
+
+ typedef struct mbstate_s mbstate_t;
+ #endif
++/*^^^^^^^^^^^^^^^^^^^^^^^^^ End Warning ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
+
+ /* FILE
* As described in <stdio.h>.
- *
- * size_t