You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/06/28 06:21:18 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 opened a new pull request #1311: libc: Move double_t typedef from sys/types.h to math.h

xiaoxiang781216 opened a new pull request #1311:
URL: https://github.com/apache/incubator-nuttx/pull/1311


   specified here:
   https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/math.h.html
   
   ## Summary
   The change make:
   1.More confirm to the standard
   2.Avoid the confliction with the 3rd party math library
   
   ## Impact
   No functionality change
   
   ## Testing
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #1311: libc: Move double_t typedef from sys/types.h to math.h

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #1311:
URL: https://github.com/apache/incubator-nuttx/pull/1311#discussion_r447371922



##########
File path: include/sys/types.h
##########
@@ -104,17 +105,6 @@
 
 #ifndef __ASSEMBLY__
 
-/* Floating point types */

Review comment:
       You don't need define CONFIG_LIBM to get these types, because math.h from the 3rd party will provide the similar typedef for you(e.g. newlib):
   https://github.com/bminor/newlib/blob/master/newlib/libc/include/math.h#L151
   Instead this patch avoid that NuttX typedef in sys/types.h is different from math.h in the 3rd party code which is important to keep the binary compatibility because all source code in NuttX use the same double_t/float_t typedef as 3rd party library.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] davids5 commented on a change in pull request #1311: libc: Move double_t typedef from sys/types.h to math.h

Posted by GitBox <gi...@apache.org>.
davids5 commented on a change in pull request #1311:
URL: https://github.com/apache/incubator-nuttx/pull/1311#discussion_r447224067



##########
File path: include/sys/types.h
##########
@@ -104,17 +105,6 @@
 
 #ifndef __ASSEMBLY__
 
-/* Floating point types */

Review comment:
       @xiaoxiang781216  I am running into problems with this change. It looks like we require now CONFIG_LIBM needs to be set to get the followinf removed from sys/types.h and moved to include/nuttx/lib/math.h
   
   ```
   typedef float        float32;	
   #ifndef CONFIG_HAVE_DOUBLE	
   typedef float        double_t;	
   typedef float        float64;	
   #else	
   typedef double       double_t;	
   typedef double       float64;	
   #endif	
   ```
   
   But if we do set CONFIG_LIBM  we loose things like `fmaxf` from the toolchain headers that do not define the moved types .  Can you offer your motivation for this change and suggest how we are expected to use it. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] Ouss4 merged pull request #1311: libc: Move double_t typedef from sys/types.h to math.h

Posted by GitBox <gi...@apache.org>.
Ouss4 merged pull request #1311:
URL: https://github.com/apache/incubator-nuttx/pull/1311


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org