Hi,
This is probably late in the 2.5.x branch, I am thinking to replace bool_t, TRUE and FALSE with their C99 standard equivalents bool, true and false.
The idea is to remove this last "anomaly" from the code base.
Thoughts? do you foresee problems with this?
Giovanni
[RFC] Killing bool_t, TRUE, FALSE
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: [RFC] Killing bool_t, TRUE, FALSE
I don't see any problems coming with this. But wait! I don't want to say that this isn't any problem, I want to say that I don't have enough knowledge to know if issues could occure.
As far as I know, ChibiOS/RT (as well as ChibiOS/GFX) is currently c89 compatible, right? I wouldn't just replace this one thing.
Personally, I'd keep it like it is. But again, I don't have any technical reasons, just personal coding style preferences.
~ Tectu
As far as I know, ChibiOS/RT (as well as ChibiOS/GFX) is currently c89 compatible, right? I wouldn't just replace this one thing.
Personally, I'd keep it like it is. But again, I don't have any technical reasons, just personal coding style preferences.
~ Tectu
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: [RFC] Killing bool_t, TRUE, FALSE
It is C89 and C99 compatible but when using C99 you have mixed definitions. The problem is that if you integrate ChibiOS with external libraries that use C99 you have this mix of bool_t, bool, false, TRUE etc in the application, ugly.
It is the same problem with integral types where at times you see u8, uint8, uint_8, u_8 uint8_t etc because authors don't even try to converge on the standard.
After the change it would be still C89 compatible by adding the C99 define/typedefs in chtypes.h for non-C99 compilers.
Giovanni
It is the same problem with integral types where at times you see u8, uint8, uint_8, u_8 uint8_t etc because authors don't even try to converge on the standard.
After the change it would be still C89 compatible by adding the C99 define/typedefs in chtypes.h for non-C99 compilers.
Giovanni
Re: [RFC] Killing bool_t, TRUE, FALSE
Seems nice to use the C99 defaults and replace the defines for the C99 standard if using a C89 compiler.
Re: [RFC] Killing bool_t, TRUE, FALSE
Giovanni, if it's possible to compile without setting the C standard to c99 I am completely okay with that ^^
But again, it's really just personal preference and no technical reason at all.
~ Tectu
But again, it's really just personal preference and no technical reason at all.
~ Tectu
Re: [RFC] Killing bool_t, TRUE, FALSE
Personally I'm voting to kill bool_t and move forward. It's 2013 outside and no obvious reason to stick to c89.
If someones compiler is that old you still can add '#define true 1', etc.
If someones compiler is that old you still can add '#define true 1', etc.
Re: [RFC] Killing bool_t, TRUE, FALSE
sounds like a sensible move. It is pretty obvious that bool is a type so no need for the _t prefix, and supporting modern compiler standards gets my vote.
Re: [RFC] Killing bool_t, TRUE, FALSE
Did this action now taken place? I don't really want to replace any bool_t, TRUE and FALSE in the GFX code but I started using the new ones in the new code that's being under development.
~ Tectu
~ Tectu
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: [RFC] Killing bool_t, TRUE, FALSE
Hi,
I placed this in the "requirements" for ChibiOS 3.0.0: http://www.chibios.org/dokuwiki/doku.ph ... _and_ideas
2.6.0 is too close and better do not break things now considering that the next one is a huge step beyond.
Giovanni
I placed this in the "requirements" for ChibiOS 3.0.0: http://www.chibios.org/dokuwiki/doku.ph ... _and_ideas
2.6.0 is too close and better do not break things now considering that the next one is a huge step beyond.
Giovanni
Return to “Development and Feedback”
Who is online
Users browsing this forum: No registered users and 17 guests