-
Notifications
You must be signed in to change notification settings - Fork 13.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to handle floating point comparison warnings (DO NOT MERGE) #1096
Conversation
Can we not test for 0.0 with isfinite() and avoid float==float and pragmas?
|
I would prefer either the division or (fabsf(val) > FLT_EPSILON). I would think that my proposal is potentially faster at execution time, but I might be off depending on the actual HW implementation. |
Some example use cases:
To me the direct set to 0.0 then check that it hasn’t changed should be isfinite method. But anything involving math at all should be the fabs method. Comments? Also: How about still using an fp_helpers.h to define exact_zero helper (using isfinite) as well as a compare (using fabs) helper inline routine. I think these can make things more understandable. On Jun 30, 2014, at 1:06 AM, Lorenz Meier [email protected] wrote:
|
Pushed up some more changes with match my proposal above. Still not compete. |
I don't agree with using two methods to implement identical logic. We should just choose one or the other. Personally, I find the isfinite approach to be more readable, though possibly less performant. Particularly when there are multiple vars to be tested. The wrapper is a nice convenience if the epsilon approach is chosen. |
The current pull state has all of these cleaned up using the following macros from fp_helpers.h: The question is whether the current code paths which look likes this: You still need is_equal_float/double as well since there is code which is doing non-zero float compares as well. Or doing zero compares which are after mathematical calculations. These case should use an epsilon based comparison. |
FLT_EPSILON sounds like a good idea, but in practice it's not good enough. Neither is the 1/x test for sufficiently small values of x. See here for a solid discussion of the issue: http://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/ In general:
(yes, these are simplistic generalisations, but as rules of thumb they are a safe starting point) |
I don't disagree with any of that. But if you look at the code base you'll find these use cases which I don't think you can get rid of:
The rest mainly fall under the don't do that rule. This pull has patches for every single one of them in the code base. Although the approach I took may be incorrect it may be a useful place to comment on each as to what should be done about it. If someone wants to point me in the right direction, I'd be happy to make the changes once a direction for each is set. Whether that is, add separate signal flags or what not. |
If folks are interested in taking this commenting approach to the discussion I can start the individual comments myself since I've gone through all of these and have decent context for most. Updating my comment: If you look through the code there about 10-15 real issues here. The rest are unit test code, testing floats. So it's not too crazy to look at these individually. |
If we're stuck with these in a wire protocol, you can rewrite them as magnitude comparisons vs. 0.5f; I think this is likely to be sufficiently clear, and at the same time ugly enough to encourage a search for a better representation in the future. 8)
If the issue here is division-by-zero, there is also the issue of INF results to consider, and comparing against zero isn't going to be sufficient there. In general, unless we expect the calculation to blow up in the normal case, I think we're better off doing the math and then checking the result for finity... |
@@ -377,7 +378,7 @@ int flow_position_estimator_thread_main(int argc, char *argv[]) | |||
{ | |||
/* simple lowpass sonar filtering */ | |||
/* if new value or with sonar update frequency */ | |||
if (sonar_new != sonar_last || counter % 10 == 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this one should have some sort of specified delta which is used to determine whether the previous versus new sonar values are different enough to care about. Certainly larger than FLT_EPSILON would seem to be too small to care about.
Does anyone know the required precision to avoid a division by zero / NaN return? That sounds like the other critical barrier we need to meet. |
I know it ain't exactly pretty but in other contexts I have simply been checking for NaN, negative & positive infinity after division. |
That seems like the safest way to do it. |
Ok. Thanks everyone. I'm going to take all this feedback and make a new pull and see what everyone thinks again. I'm going to leave this pull open for now as a reference. |
I see nothing particularly wrong with using float equality with zero as a flag, other than the fact that the compiler endlessly complains about it! All of the methods suggested here cause the compiler to generate extra instructions. One way around the compiler warning that will not trigger the warning nor cause the generation of extra instruction (with the optimize flags we use) follows: Instead of if (x == 0.0) ... use if (!((x < 0.0) || (x > 0.0))) ... This would of course need to be incorporated as a macro. ie: #define floatEquals0(a) (!((a < 0.0)||(a>0.0))) |
@jean-m-cyr The proposal is fair and would be equivalent as you note. However, adding the additional requirement of really offering a div-by-zero check, I'm wondering what a suitably large number would be in float. We will not be able to give a definite answer there, but I would suspect checking for zero is not enough - we probably need something like num < 1e-7 to be on the safe side. |
I was only referring to the case where 0 is assigned to a float to indicate an uninitialized state (often the case in PX4 code). As in: float x = 0.0f; |
Jean, When passed to a function, this is actually more expensive (move from vector register to GP register, arithmetic) than just stacking an argument to the function. In general, in-band magic values are bad; we should not use them. On Jul 3, 2014, at 11:13 AM, Jean Cyr [email protected] wrote:
|
Only true if the float is not be passed as an argument in the first place, I agree with you on avoiding magic values, but we're way past that in our On Thu, Jul 3, 2014 at 2:15 PM, px4dev [email protected] wrote:
|
Lorenz, 1e-7 for ALL is not good at all. Do you know apriori units and valid values range? In some calculations intermediate values ~1e-7 may be normal. Band checks should be performed only if band is known, e.g. when using floats in mavlink message as flags. BTW, in normal code this must not happen at all, division by near zero value should be performed only after check (e.g. for derivative calculation we know minimal acceptable dt). So final value check for NAN should be enough. |
Lets separate the discussion into two parts:
My proposal is to use the fp_helpers macros to solve #1 while not attempting to solve problem #2. In doing so I will not change the current semantics or float usage pattern in the existing code. The macros then provide the mechanism to easily find all questionable float usage, just like the -Wfloat-equal compiler warning is doing now. And then the discussion can continue separately in what to do about #2. This way we can at least move forward more quickly on the compiler warnings. On Jul 3, 2014, at 11:33 AM, Anton Babushkin [email protected] wrote:
|
In 1) you propose to add further bloat by replacing what should be a simple comparison with extra floating point operations, just to eliminate compiler warnings??? Instead of: #define is_exactly_zero_float(f) (!isfinite(1.0f/(f))) why not: #define is_exactly_zero_float(f) (!((f < 0.0f)||(f > 0.0f))) The compiler's optimization stage is smart enough to recognize that these are just equal 0 comparisons and will generate the same instructions as thought you had coded and simple check for 0.0, but will not generate the float equality warning. |
Oops... should have been #define is_exactly_zero_double(d) (!((d < 0.0)||(d > 0.0))) |
At the very least, let's just have one macro that works for both float and double arguments. For the current platform, float and double are the same type. IFF you care about portability, consider using a combination of typeof() and decltype. Please note that your test assumes that NAN and INF are zero. |
decltype is C++ only. This needs to work in both C and C++ code On Jul 4, 2014, at 10:20 AM, px4dev [email protected] wrote:
|
All of this is to avoid using #pragma’s to turn off compiler warnings around a simple f == 0.0f comparison. Which to me seems like a waste of time. I’m going to go back to the pragma + inline method in fp_helpers. As I said I’m going to leave the code exactly as it is, just encapsulate it in inline helper functions to silence the warning. After that anyone else is welcome to change the code to their favorite floating point mechanism. Then I’ll move on to cleaning up the rest of the warnings. On Jul 4, 2014, at 9:10 AM, Jean Cyr [email protected] wrote:
|
Hmm... I'm not sure it is legal to include a #pragma statement inside of a #define, or are you talking about using #pragma inside of an inline function? Don't forget that the inline specification is only a suggestion to the compiler which it may ignore. You might end up with a bunch of function calls to a bunch of duplicate instantiations of the is_exactly_zero function. Seems to me that the #define mechanism would yield more predictable results. |
It’s not. This will work in both C and C++ and end up being exactly what the code is now except for the warnings: extern inline bool is_exactly_zero_float(float f); extern inline bool is_exactly_zero_float(float f) extern inline bool is_exactly_zero_double(double d); extern inline bool is_exactly_zero_double(double d) On Jul 4, 2014, at 11:26 AM, Jean Cyr [email protected] wrote:
|
(Don; hence recommending a mix of typeof() (C only) and decltype.) Folks; we seem to be missing the point here. The reason these warnings are turned on is to help find and fix code that is doing bad things with floating point numbers. Adding a mechanism for silencing the warnings is the wrong thing to do, because all you achieve is teaching people how to silence legitimate warnings when they come up. We disallow equality comparisons between floating point numbers because sufficiently often this is the wrong thing to do, and thus it should not be done simply as a matter of course. The correct, and only, fix for these warnings is to amend the code to DTRT. |
Ok. I’m going to move on from here. I’m going to clean up all the other compiler warnings and leave the float ones for someone else to deal with. I don’t think there is a consensus on what you say below as absolutely being true. Nor is there any consensus on how to correctly fix the code to legitimately avoid to warnings. Float comparison is obviously contentious. Which can be seen even in the compiler settings as well, with the fact the -Wfloat-equal is not included in the -Wall or -Wextra set of standard warnings. You have to explicitly turn it on. Someone who knows more about the codebase and what is actually intended is going to have to handle this. On Jul 4, 2014, at 1:29 PM, px4dev [email protected] wrote:
|
Don, Your push is really appreciated. I think I can sit down tomorrow and eliminate a big share of them properly. Your suggested path makes perfect sense. |
NuttX: - https://github.com/PX4-NuttX/nuttx/tree/master - PX4/NuttX@a0429bc Changes from PX4/NuttX (PX4/NuttX@9331fda) in current PX4/master (7abadab) PX4/NuttX@9331fda...a0429bc a0429bc (HEAD, origin/master) Merged in raiden00/nuttx_nrf52 (pull request #1096) bc7566a arch/arm/include/armv7-m/syscall.h: ARM EABI specifies that the stack should be aligned by 8 on function calls, inside the function is not required to be aligned by 8. Since these functions call svc, compiler doesn't know that the svc is a function, therefore it does not do any stack management. This change pushes an even number of args to the stack and maintains an 8 byte alignment. I've checked the assembly and it doesn't cause any more overhead that the hand written assembly. 68b0ba8 arch/sim/src/sim/up_framebuffer.c: Replace all _info/_err with ginfo/gerr. 3a5e2b7 arch/sim/src/: Simulator restore the console even error handler call host exit directly. 6c362c8 arch/sim/src/sim/: Remove unnecessary initialization log from simulator initialization. af5d0d3 boards/sim/sim/sim/src/sim_bringup.c: Simulator shouldn't assume that graphics stack is enabled if both X11 framebuffer and touchscreen driver turn on. 3c472dc boards/sim/sim/sim/src/sim_bringup.c: Force format little fs before mount. 541bfe9 Revert "boards/arm/am335x/beaglebone-black/src/am335x_bringup.c: CAN0 and CAN1 reversed in one place. Spotted by Alan Carvahlo de Assis." 6bff1f4 arch/arm/include/samd2l2/sam_adc.h: I was wrong... this header file does belong in the samd2l2 include directory. It contains IOCTL definitions that are needed by applications. Usage of a chip-specific header file is, however, not really a good portable design because it requires that the application know that it is running on a specific chip. But still, if we are going to do that, the include directory is where the header file belongs. My apologies for the bad judgement. 77eea3d boards/arm/am335x/beaglebone-black/src/am335x_bringup.c: CAN0 and CAN1 reversed in one place. Spotted by Alan Carvahlo de Assis. Apps: - https://github.com/PX4/NuttX-apps/tree/master - PX4/NuttX-apps@e48a74f Changes from PX4/NuttX-apps (PX4/NuttX-apps@91b6ad6) in current PX4/master (7abadab) PX4/NuttX-apps@91b6ad6...e48a74f e48a74f3 (HEAD -> master, origin/master) apps/Application.mk: Convert object names to guarantee uniqueness. 5ec8fc94 apps/nshlib/nsh_fileapps.c: nsh_fileapp() should return 1 if the application task was spawned successfully but returned failure exit status. For example, nsh shouldn't output "/bin/ping: command not found": 77a3b083 apps/nshlib/nsh_parse.c: Ensure /bin/ping and ping work at the same time. Don't skip nsh_builtin even CONFIG_NSH_FILE_APPS or CONFIG_FS_BINFS equal y. 3da8091d Include nuttx/symtab.h instead of nuttx/binfmt/symtab.h since symtab.h under binfmt folder is for internal use. 7479cd68 apps/system/nsh/nsh_main.c: Remove HAVE_DUMMY_SYMTAB logic since BINFS can run without it. e305592c apps/examples/tcpblaster: Fix several problems with the host is the client and the target in the server. Basic problem was that the host did not know the IP address of the target server due to several bugs and build issues that only seemed to affect this configuration. 7b4a3ac5 graphics/littlevgl/Makefile: Temporary fix LVGL compilation until we update to version 6.1.1. 0218a2fc Fix compiler warnings: 3bf17d60 apps/netutils/ftpc: ix the compiler warnings: ee53a90f apps/netutils/ntpclient/Kconfig: NTP client should depend on NET_SOCKOPTS.
NuttX: - https://github.com/PX4-NuttX/nuttx/tree/master - PX4/NuttX@e7c9c89 Changes from PX4/NuttX (PX4/NuttX@9331fda) in current PX4/master (7abadab) PX4/NuttX@9331fda...e7c9c89 e7c9c89 (HEAD, origin/master) Trivial updates to files modified in last PR based on results of tools/nxstyle. a0429bc Merged in raiden00/nuttx_nrf52 (pull request #1096) bc7566a arch/arm/include/armv7-m/syscall.h: ARM EABI specifies that the stack should be aligned by 8 on function calls, inside the function is not required to be aligned by 8. Since these functions call svc, compiler doesn't know that the svc is a function, therefore it does not do any stack management. This change pushes an even number of args to the stack and maintains an 8 byte alignment. I've checked the assembly and it doesn't cause any more overhead that the hand written assembly. 68b0ba8 arch/sim/src/sim/up_framebuffer.c: Replace all _info/_err with ginfo/gerr. 3a5e2b7 arch/sim/src/: Simulator restore the console even error handler call host exit directly. 6c362c8 arch/sim/src/sim/: Remove unnecessary initialization log from simulator initialization. af5d0d3 boards/sim/sim/sim/src/sim_bringup.c: Simulator shouldn't assume that graphics stack is enabled if both X11 framebuffer and touchscreen driver turn on. 3c472dc boards/sim/sim/sim/src/sim_bringup.c: Force format little fs before mount. 541bfe9 Revert "boards/arm/am335x/beaglebone-black/src/am335x_bringup.c: CAN0 and CAN1 reversed in one place. Spotted by Alan Carvahlo de Assis." 6bff1f4 arch/arm/include/samd2l2/sam_adc.h: I was wrong... this header file does belong in the samd2l2 include directory. It contains IOCTL definitions that are needed by applications. Usage of a chip-specific header file is, however, not really a good portable design because it requires that the application know that it is running on a specific chip. But still, if we are going to do that, the include directory is where the header file belongs. My apologies for the bad judgement. Apps: - https://github.com/PX4/NuttX-apps/tree/master - PX4/NuttX-apps@e48a74f Changes from PX4/NuttX-apps (PX4/NuttX-apps@91b6ad6) in current PX4/master (7abadab) PX4/NuttX-apps@91b6ad6...e48a74f e48a74f3 (HEAD -> master, origin/master) apps/Application.mk: Convert object names to guarantee uniqueness. 5ec8fc94 apps/nshlib/nsh_fileapps.c: nsh_fileapp() should return 1 if the application task was spawned successfully but returned failure exit status. For example, nsh shouldn't output "/bin/ping: command not found": 77a3b083 apps/nshlib/nsh_parse.c: Ensure /bin/ping and ping work at the same time. Don't skip nsh_builtin even CONFIG_NSH_FILE_APPS or CONFIG_FS_BINFS equal y. 3da8091d Include nuttx/symtab.h instead of nuttx/binfmt/symtab.h since symtab.h under binfmt folder is for internal use. 7479cd68 apps/system/nsh/nsh_main.c: Remove HAVE_DUMMY_SYMTAB logic since BINFS can run without it. e305592c apps/examples/tcpblaster: Fix several problems with the host is the client and the target in the server. Basic problem was that the host did not know the IP address of the target server due to several bugs and build issues that only seemed to affect this configuration. 7b4a3ac5 graphics/littlevgl/Makefile: Temporary fix LVGL compilation until we update to version 6.1.1. 0218a2fc Fix compiler warnings: 3bf17d60 apps/netutils/ftpc: ix the compiler warnings: ee53a90f apps/netutils/ntpclient/Kconfig: NTP client should depend on NET_SOCKOPTS.
NuttX: - https://github.com/PX4-NuttX/nuttx/tree/master - PX4/NuttX@fed50a1 Changes from PX4/NuttX (PX4/NuttX@9331fda) in current PX4/master (7abadab) PX4/NuttX@9331fda...fed50a1 fed50a1 (HEAD, origin/master) include/nuttx/wireless/wireless.h: Correct number of network commands. e7c9c89 Trivial updates to files modified in last PR based on results of tools/nxstyle. a0429bc Merged in raiden00/nuttx_nrf52 (pull request #1096) bc7566a arch/arm/include/armv7-m/syscall.h: ARM EABI specifies that the stack should be aligned by 8 on function calls, inside the function is not required to be aligned by 8. Since these functions call svc, compiler doesn't know that the svc is a function, therefore it does not do any stack management. This change pushes an even number of args to the stack and maintains an 8 byte alignment. I've checked the assembly and it doesn't cause any more overhead that the hand written assembly. 68b0ba8 arch/sim/src/sim/up_framebuffer.c: Replace all _info/_err with ginfo/gerr. 3a5e2b7 arch/sim/src/: Simulator restore the console even error handler call host exit directly. 6c362c8 arch/sim/src/sim/: Remove unnecessary initialization log from simulator initialization. af5d0d3 boards/sim/sim/sim/src/sim_bringup.c: Simulator shouldn't assume that graphics stack is enabled if both X11 framebuffer and touchscreen driver turn on. 3c472dc boards/sim/sim/sim/src/sim_bringup.c: Force format little fs before mount. 541bfe9 Revert "boards/arm/am335x/beaglebone-black/src/am335x_bringup.c: CAN0 and CAN1 reversed in one place. Spotted by Alan Carvahlo de Assis." Apps: - https://github.com/PX4/NuttX-apps/tree/master - PX4/NuttX-apps@e48a74f Changes from PX4/NuttX-apps (PX4/NuttX-apps@91b6ad6) in current PX4/master (7abadab) PX4/NuttX-apps@91b6ad6...e48a74f e48a74f3 (HEAD -> master, origin/master) apps/Application.mk: Convert object names to guarantee uniqueness. 5ec8fc94 apps/nshlib/nsh_fileapps.c: nsh_fileapp() should return 1 if the application task was spawned successfully but returned failure exit status. For example, nsh shouldn't output "/bin/ping: command not found": 77a3b083 apps/nshlib/nsh_parse.c: Ensure /bin/ping and ping work at the same time. Don't skip nsh_builtin even CONFIG_NSH_FILE_APPS or CONFIG_FS_BINFS equal y. 3da8091d Include nuttx/symtab.h instead of nuttx/binfmt/symtab.h since symtab.h under binfmt folder is for internal use. 7479cd68 apps/system/nsh/nsh_main.c: Remove HAVE_DUMMY_SYMTAB logic since BINFS can run without it. e305592c apps/examples/tcpblaster: Fix several problems with the host is the client and the target in the server. Basic problem was that the host did not know the IP address of the target server due to several bugs and build issues that only seemed to affect this configuration. 7b4a3ac5 graphics/littlevgl/Makefile: Temporary fix LVGL compilation until we update to version 6.1.1. 0218a2fc Fix compiler warnings: 3bf17d60 apps/netutils/ftpc: ix the compiler warnings: ee53a90f apps/netutils/ntpclient/Kconfig: NTP client should depend on NET_SOCKOPTS.
NuttX: - https://github.com/PX4-NuttX/nuttx/tree/master - PX4/NuttX@13038d0 Changes from PX4/NuttX (PX4/NuttX@9331fda) in current PX4/master (a46add9) PX4/NuttX@9331fda...13038d0 13038d0 (HEAD, origin/master) Documentation/NuttX.html: Fix MIPS32 references. fed50a1 include/nuttx/wireless/wireless.h: Correct number of network commands. e7c9c89 Trivial updates to files modified in last PR based on results of tools/nxstyle. a0429bc Merged in raiden00/nuttx_nrf52 (pull request #1096) bc7566a arch/arm/include/armv7-m/syscall.h: ARM EABI specifies that the stack should be aligned by 8 on function calls, inside the function is not required to be aligned by 8. Since these functions call svc, compiler doesn't know that the svc is a function, therefore it does not do any stack management. This change pushes an even number of args to the stack and maintains an 8 byte alignment. I've checked the assembly and it doesn't cause any more overhead that the hand written assembly. 68b0ba8 arch/sim/src/sim/up_framebuffer.c: Replace all _info/_err with ginfo/gerr. 3a5e2b7 arch/sim/src/: Simulator restore the console even error handler call host exit directly. 6c362c8 arch/sim/src/sim/: Remove unnecessary initialization log from simulator initialization. af5d0d3 boards/sim/sim/sim/src/sim_bringup.c: Simulator shouldn't assume that graphics stack is enabled if both X11 framebuffer and touchscreen driver turn on. 3c472dc boards/sim/sim/sim/src/sim_bringup.c: Force format little fs before mount. Apps: - https://github.com/PX4/NuttX-apps/tree/master - PX4/NuttX-apps@9defae8 Changes from PX4/NuttX-apps (PX4/NuttX-apps@91b6ad6) in current PX4/master (a46add9) PX4/NuttX-apps@91b6ad6...9defae8 9defae8a (HEAD -> master, origin/master) apps/nshlib/nsh_parse.c: Fix warning: 'g_nullstring defined but not used'. Use directly since the usage is triggered by a complex Kconfig combination. 3a2bd2c0 apps/netutils/ntpclient/ntpclient.c: Merge local structure variables xmit and recv into pkt to save the stack. e48a74f3 apps/Application.mk: Convert object names to guarantee uniqueness. 5ec8fc94 apps/nshlib/nsh_fileapps.c: nsh_fileapp() should return 1 if the application task was spawned successfully but returned failure exit status. For example, nsh shouldn't output "/bin/ping: command not found": 77a3b083 apps/nshlib/nsh_parse.c: Ensure /bin/ping and ping work at the same time. Don't skip nsh_builtin even CONFIG_NSH_FILE_APPS or CONFIG_FS_BINFS equal y. 3da8091d Include nuttx/symtab.h instead of nuttx/binfmt/symtab.h since symtab.h under binfmt folder is for internal use. 7479cd68 apps/system/nsh/nsh_main.c: Remove HAVE_DUMMY_SYMTAB logic since BINFS can run without it. e305592c apps/examples/tcpblaster: Fix several problems with the host is the client and the target in the server. Basic problem was that the host did not know the IP address of the target server due to several bugs and build issues that only seemed to affect this configuration. 7b4a3ac5 graphics/littlevgl/Makefile: Temporary fix LVGL compilation until we update to version 6.1.1. 0218a2fc Fix compiler warnings:
NuttX: - https://github.com/PX4-NuttX/nuttx/tree/master - PX4/NuttX@466ab56 Changes from PX4/NuttX (PX4/NuttX@9331fda) in current PX4/master (2a848c3) PX4/NuttX@9331fda...466ab56 466ab56 (HEAD, origin/master) Merged in masayuki2009/nuttx.nuttx/fe310_gpio (pull request #1097) 13038d0 Documentation/NuttX.html: Fix MIPS32 references. fed50a1 include/nuttx/wireless/wireless.h: Correct number of network commands. e7c9c89 Trivial updates to files modified in last PR based on results of tools/nxstyle. a0429bc Merged in raiden00/nuttx_nrf52 (pull request #1096) bc7566a arch/arm/include/armv7-m/syscall.h: ARM EABI specifies that the stack should be aligned by 8 on function calls, inside the function is not required to be aligned by 8. Since these functions call svc, compiler doesn't know that the svc is a function, therefore it does not do any stack management. This change pushes an even number of args to the stack and maintains an 8 byte alignment. I've checked the assembly and it doesn't cause any more overhead that the hand written assembly. 68b0ba8 arch/sim/src/sim/up_framebuffer.c: Replace all _info/_err with ginfo/gerr. 3a5e2b7 arch/sim/src/: Simulator restore the console even error handler call host exit directly. 6c362c8 arch/sim/src/sim/: Remove unnecessary initialization log from simulator initialization. af5d0d3 boards/sim/sim/sim/src/sim_bringup.c: Simulator shouldn't assume that graphics stack is enabled if both X11 framebuffer and touchscreen driver turn on. Apps: - https://github.com/PX4/NuttX-apps/tree/master - PX4/NuttX-apps@9defae8 Changes from PX4/NuttX-apps (PX4/NuttX-apps@91b6ad6) in current PX4/master (2a848c3) PX4/NuttX-apps@91b6ad6...9defae8 9defae8a (HEAD -> master, origin/master) apps/nshlib/nsh_parse.c: Fix warning: 'g_nullstring defined but not used'. Use directly since the usage is triggered by a complex Kconfig combination. 3a2bd2c0 apps/netutils/ntpclient/ntpclient.c: Merge local structure variables xmit and recv into pkt to save the stack. e48a74f3 apps/Application.mk: Convert object names to guarantee uniqueness. 5ec8fc94 apps/nshlib/nsh_fileapps.c: nsh_fileapp() should return 1 if the application task was spawned successfully but returned failure exit status. For example, nsh shouldn't output "/bin/ping: command not found": 77a3b083 apps/nshlib/nsh_parse.c: Ensure /bin/ping and ping work at the same time. Don't skip nsh_builtin even CONFIG_NSH_FILE_APPS or CONFIG_FS_BINFS equal y. 3da8091d Include nuttx/symtab.h instead of nuttx/binfmt/symtab.h since symtab.h under binfmt folder is for internal use. 7479cd68 apps/system/nsh/nsh_main.c: Remove HAVE_DUMMY_SYMTAB logic since BINFS can run without it. e305592c apps/examples/tcpblaster: Fix several problems with the host is the client and the target in the server. Basic problem was that the host did not know the IP address of the target server due to several bugs and build issues that only seemed to affect this configuration. 7b4a3ac5 graphics/littlevgl/Makefile: Temporary fix LVGL compilation until we update to version 6.1.1. 0218a2fc Fix compiler warnings:
NuttX: - https://github.com/PX4-NuttX/nuttx/tree/master - PX4/NuttX@d80d6b8 Changes from PX4/NuttX (PX4/NuttX@9331fda) in current PX4/master (a9ca16c) PX4/NuttX@9331fda...d80d6b8 d80d6b8 (HEAD, origin/master) Merged in raiden00/nuttx_nrf52 (pull request #1098) 466ab56 Merged in masayuki2009/nuttx.nuttx/fe310_gpio (pull request #1097) 13038d0 Documentation/NuttX.html: Fix MIPS32 references. fed50a1 include/nuttx/wireless/wireless.h: Correct number of network commands. e7c9c89 Trivial updates to files modified in last PR based on results of tools/nxstyle. a0429bc Merged in raiden00/nuttx_nrf52 (pull request #1096) bc7566a arch/arm/include/armv7-m/syscall.h: ARM EABI specifies that the stack should be aligned by 8 on function calls, inside the function is not required to be aligned by 8. Since these functions call svc, compiler doesn't know that the svc is a function, therefore it does not do any stack management. This change pushes an even number of args to the stack and maintains an 8 byte alignment. I've checked the assembly and it doesn't cause any more overhead that the hand written assembly. 68b0ba8 arch/sim/src/sim/up_framebuffer.c: Replace all _info/_err with ginfo/gerr. 3a5e2b7 arch/sim/src/: Simulator restore the console even error handler call host exit directly. 6c362c8 arch/sim/src/sim/: Remove unnecessary initialization log from simulator initialization. Apps: - https://github.com/PX4/NuttX-apps/tree/master - PX4/NuttX-apps@2a462c7 Changes from PX4/NuttX-apps (PX4/NuttX-apps@91b6ad6) in current PX4/master (a9ca16c) PX4/NuttX-apps@91b6ad6...2a462c7 2a462c78 (HEAD -> master, origin/master) nshlib/nsh_parse.c: Replacement implementation for 9defae8af641752506d92b72ea68c8f94d24d580. This addes conditional compilation on the definition of g_nullstring[] to avoid the warning. Suggested by SUZUKI Y <[email protected]> 6bfd6166 Revert "apps/nshlib/nsh_parse.c: Fix warning: 'g_nullstring defined but not used'. Use directly since the usage is triggered by a complex Kconfig combination." 9b77f807 apps/netutils/dhcpd/dhcpd.c: Correct backward conditional logic in dhcpd_leaseexpired(). Noted by surya prakash <[email protected]>. 9defae8a apps/nshlib/nsh_parse.c: Fix warning: 'g_nullstring defined but not used'. Use directly since the usage is triggered by a complex Kconfig combination. 3a2bd2c0 apps/netutils/ntpclient/ntpclient.c: Merge local structure variables xmit and recv into pkt to save the stack. e48a74f3 apps/Application.mk: Convert object names to guarantee uniqueness. 5ec8fc94 apps/nshlib/nsh_fileapps.c: nsh_fileapp() should return 1 if the application task was spawned successfully but returned failure exit status. For example, nsh shouldn't output "/bin/ping: command not found": 77a3b083 apps/nshlib/nsh_parse.c: Ensure /bin/ping and ping work at the same time. Don't skip nsh_builtin even CONFIG_NSH_FILE_APPS or CONFIG_FS_BINFS equal y. 3da8091d Include nuttx/symtab.h instead of nuttx/binfmt/symtab.h since symtab.h under binfmt folder is for internal use. 7479cd68 apps/system/nsh/nsh_main.c: Remove HAVE_DUMMY_SYMTAB logic since BINFS can run without it.
NuttX: - https://github.com/PX4-NuttX/nuttx/tree/master - PX4/NuttX@15f2889 Changes from PX4/NuttX (PX4/NuttX@9331fda) in current PX4/master (e4a526e) PX4/NuttX@9331fda...15f2889 15f2889 (HEAD, origin/master) Merged in masayuki2009/nuttx.nuttx/fix_fe310_signal (pull request #1099) d80d6b8 Merged in raiden00/nuttx_nrf52 (pull request #1098) 466ab56 Merged in masayuki2009/nuttx.nuttx/fe310_gpio (pull request #1097) 13038d0 Documentation/NuttX.html: Fix MIPS32 references. fed50a1 include/nuttx/wireless/wireless.h: Correct number of network commands. e7c9c89 Trivial updates to files modified in last PR based on results of tools/nxstyle. a0429bc Merged in raiden00/nuttx_nrf52 (pull request #1096) bc7566a arch/arm/include/armv7-m/syscall.h: ARM EABI specifies that the stack should be aligned by 8 on function calls, inside the function is not required to be aligned by 8. Since these functions call svc, compiler doesn't know that the svc is a function, therefore it does not do any stack management. This change pushes an even number of args to the stack and maintains an 8 byte alignment. I've checked the assembly and it doesn't cause any more overhead that the hand written assembly. 68b0ba8 arch/sim/src/sim/up_framebuffer.c: Replace all _info/_err with ginfo/gerr. 3a5e2b7 arch/sim/src/: Simulator restore the console even error handler call host exit directly. Apps: - https://github.com/PX4/NuttX-apps/tree/master - PX4/NuttX-apps@2a462c7 Changes from PX4/NuttX-apps (PX4/NuttX-apps@91b6ad6) in current PX4/master (e4a526e) PX4/NuttX-apps@91b6ad6...2a462c7 2a462c78 (HEAD -> master, origin/master) nshlib/nsh_parse.c: Replacement implementation for 9defae8af641752506d92b72ea68c8f94d24d580. This addes conditional compilation on the definition of g_nullstring[] to avoid the warning. Suggested by SUZUKI Y <[email protected]> 6bfd6166 Revert "apps/nshlib/nsh_parse.c: Fix warning: 'g_nullstring defined but not used'. Use directly since the usage is triggered by a complex Kconfig combination." 9b77f807 apps/netutils/dhcpd/dhcpd.c: Correct backward conditional logic in dhcpd_leaseexpired(). Noted by surya prakash <[email protected]>. 9defae8a apps/nshlib/nsh_parse.c: Fix warning: 'g_nullstring defined but not used'. Use directly since the usage is triggered by a complex Kconfig combination. 3a2bd2c0 apps/netutils/ntpclient/ntpclient.c: Merge local structure variables xmit and recv into pkt to save the stack. e48a74f3 apps/Application.mk: Convert object names to guarantee uniqueness. 5ec8fc94 apps/nshlib/nsh_fileapps.c: nsh_fileapp() should return 1 if the application task was spawned successfully but returned failure exit status. For example, nsh shouldn't output "/bin/ping: command not found": 77a3b083 apps/nshlib/nsh_parse.c: Ensure /bin/ping and ping work at the same time. Don't skip nsh_builtin even CONFIG_NSH_FILE_APPS or CONFIG_FS_BINFS equal y. 3da8091d Include nuttx/symtab.h instead of nuttx/binfmt/symtab.h since symtab.h under binfmt folder is for internal use. 7479cd68 apps/system/nsh/nsh_main.c: Remove HAVE_DUMMY_SYMTAB logic since BINFS can run without it.
NuttX: - https://github.com/PX4-NuttX/nuttx/tree/master - PX4/NuttX@54d6a07 Changes from PX4/NuttX (PX4/NuttX@9331fda) in current PX4/master (49cb210) PX4/NuttX@9331fda...54d6a07 54d6a07 (HEAD, origin/master) boards/arm/stm32f0l0g0/: Fix issues noted by nxstyle. b9638de boards/arm/stm32f0l0g0/nucleo-g070rb: Enable I2C. eeed40a arch/arm/src/stm32f0l0g0/ and boards/arm/stm32f0l0g0/nucleo-g070rb/include/board.h: Add I2C pinmap. In Kconfig select I2C2 for this part. Update I2C pin definitions in board.h. 15f2889 Merged in masayuki2009/nuttx.nuttx/fix_fe310_signal (pull request #1099) d80d6b8 Merged in raiden00/nuttx_nrf52 (pull request #1098) 466ab56 Merged in masayuki2009/nuttx.nuttx/fe310_gpio (pull request #1097) 13038d0 Documentation/NuttX.html: Fix MIPS32 references. fed50a1 include/nuttx/wireless/wireless.h: Correct number of network commands. e7c9c89 Trivial updates to files modified in last PR based on results of tools/nxstyle. a0429bc Merged in raiden00/nuttx_nrf52 (pull request #1096) Apps: - https://github.com/PX4/NuttX-apps/tree/master - PX4/NuttX-apps@2a462c7 Changes from PX4/NuttX-apps (PX4/NuttX-apps@91b6ad6) in current PX4/master (49cb210) PX4/NuttX-apps@91b6ad6...2a462c7 2a462c78 (HEAD -> master, origin/master) nshlib/nsh_parse.c: Replacement implementation for 9defae8af641752506d92b72ea68c8f94d24d580. This addes conditional compilation on the definition of g_nullstring[] to avoid the warning. Suggested by SUZUKI Y <[email protected]> 6bfd6166 Revert "apps/nshlib/nsh_parse.c: Fix warning: 'g_nullstring defined but not used'. Use directly since the usage is triggered by a complex Kconfig combination." 9b77f807 apps/netutils/dhcpd/dhcpd.c: Correct backward conditional logic in dhcpd_leaseexpired(). Noted by surya prakash <[email protected]>. 9defae8a apps/nshlib/nsh_parse.c: Fix warning: 'g_nullstring defined but not used'. Use directly since the usage is triggered by a complex Kconfig combination. 3a2bd2c0 apps/netutils/ntpclient/ntpclient.c: Merge local structure variables xmit and recv into pkt to save the stack. e48a74f3 apps/Application.mk: Convert object names to guarantee uniqueness. 5ec8fc94 apps/nshlib/nsh_fileapps.c: nsh_fileapp() should return 1 if the application task was spawned successfully but returned failure exit status. For example, nsh shouldn't output "/bin/ping: command not found": 77a3b083 apps/nshlib/nsh_parse.c: Ensure /bin/ping and ping work at the same time. Don't skip nsh_builtin even CONFIG_NSH_FILE_APPS or CONFIG_FS_BINFS equal y. 3da8091d Include nuttx/symtab.h instead of nuttx/binfmt/symtab.h since symtab.h under binfmt folder is for internal use. 7479cd68 apps/system/nsh/nsh_main.c: Remove HAVE_DUMMY_SYMTAB logic since BINFS can run without it.
There are quite a few of these. I've looked at most of them and they are legitimate == 0.0 comparisons when the float was directly set to 0.0. One way to handle them is to turn off -Wno-float-equal. Another is using the mechanism in this pull (or something similar). Looking for comments on what direction to head.