Re: [PATCH 0/3] Fix Missing break in switch Coverity issues

2021-03-10 Thread Chris Johns



On 9/3/21 5:28 pm, Gedare Bloom wrote:
> On Mon, Mar 8, 2021 at 11:04 PM Sebastian Huber
>  wrote:
>>
>> On 09/03/2021 06:47, Gedare Bloom wrote:
>>
>> I would just use a comment which is understood by GCC, clang, and
>> Coverity. What does Linux use?
>>
> That's fine, if there is a de facto standard to use, we can go for it.
 Looking at the option documentation gcc supports a lot of different 
 possible
 ways and the warning option can change what is selected.

 Do we allow all that gcc allows? I hope not.

>>> As with other things we should provide a portable way to maintain it.
>>> I would suggest adding to basedefs.h:
>>> #define RTEMS_CASE_FALL_THROUGH
>>> macro as reasonably simple. We can debate a few variations
>>> RTEMS_CASE_FALLTHRU is short and sufficient.
>>>
>>> Most likely we'll never have to change it, but this will simplify code
>>> review and avoid typos /* fall-trough */
>>
>> Linux uses a macro:
>>
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2bf74771ca5610b10c3ac4cd17aacc389e6927ca
>>
>> My favorite name is RTEMS_FALL_THROUGH.
>>
> Fine with me.

Looks good to me.

Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH 0/3] Fix Missing break in switch Coverity issues

2021-03-08 Thread Gedare Bloom
On Mon, Mar 8, 2021 at 11:04 PM Sebastian Huber
 wrote:
>
> On 09/03/2021 06:47, Gedare Bloom wrote:
>
>  I would just use a comment which is understood by GCC, clang, and
>  Coverity. What does Linux use?
> 
> >>> That's fine, if there is a de facto standard to use, we can go for it.
> >> Looking at the option documentation gcc supports a lot of different 
> >> possible
> >> ways and the warning option can change what is selected.
> >>
> >> Do we allow all that gcc allows? I hope not.
> >>
> > As with other things we should provide a portable way to maintain it.
> > I would suggest adding to basedefs.h:
> > #define RTEMS_CASE_FALL_THROUGH
> > macro as reasonably simple. We can debate a few variations
> > RTEMS_CASE_FALLTHRU is short and sufficient.
> >
> > Most likely we'll never have to change it, but this will simplify code
> > review and avoid typos /* fall-trough */
>
> Linux uses a macro:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2bf74771ca5610b10c3ac4cd17aacc389e6927ca
>
> My favorite name is RTEMS_FALL_THROUGH.
>
Fine with me.

> >
> --
> embedded brains GmbH
> Herr Sebastian HUBER
> Dornierstr. 4
> 82178 Puchheim
> Germany
> email: sebastian.hu...@embedded-brains.de
> phone: +49-89-18 94 741 - 16
> fax:   +49-89-18 94 741 - 08
>
> Registergericht: Amtsgericht München
> Registernummer: HRB 157899
> Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
> Unsere Datenschutzerklärung finden Sie hier:
> https://embedded-brains.de/datenschutzerklaerung/
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH 0/3] Fix Missing break in switch Coverity issues

2021-03-08 Thread Sebastian Huber

On 09/03/2021 06:47, Gedare Bloom wrote:


I would just use a comment which is understood by GCC, clang, and
Coverity. What does Linux use?


That's fine, if there is a de facto standard to use, we can go for it.

Looking at the option documentation gcc supports a lot of different possible
ways and the warning option can change what is selected.

Do we allow all that gcc allows? I hope not.


As with other things we should provide a portable way to maintain it.
I would suggest adding to basedefs.h:
#define RTEMS_CASE_FALL_THROUGH
macro as reasonably simple. We can debate a few variations
RTEMS_CASE_FALLTHRU is short and sufficient.

Most likely we'll never have to change it, but this will simplify code
review and avoid typos /* fall-trough */


Linux uses a macro:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2bf74771ca5610b10c3ac4cd17aacc389e6927ca

My favorite name is RTEMS_FALL_THROUGH.




--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH 0/3] Fix Missing break in switch Coverity issues

2021-03-08 Thread Gedare Bloom
On Mon, Mar 8, 2021 at 7:21 PM Chris Johns  wrote:
>
> On 6/3/21 6:04 am, Gedare Bloom wrote:
> > On Fri, Mar 5, 2021 at 11:48 AM Sebastian Huber
> >  wrote:
> >>
> >> On 05/03/2021 19:40, Joel Sherrill wrote:
> >>
> >>> On Fri, Mar 5, 2021, 12:25 PM Sebastian Huber
> >>>  >>> > wrote:
> >>>
> >>> On 05/03/2021 16:27, Gedare Bloom wrote:
> >>>
> >>> > Should we add a macro for this, e.g., "RTEMS_CASE_NO_BREAK" so
> >>> that we
> >>> > can update them in future if needed for other tools?
> >>> I would just pick a name which is understood by GCC, clang, and
> >>> Coverity. I guess other tools will understand this or why did you
> >>> buy them?
> >>>
> >>>
> >>> Well we didn't pay for any of those but are you wanting a macro or
> >>> just the comment?
> >>
> >> I would just use a comment which is understood by GCC, clang, and
> >> Coverity. What does Linux use?
> >>
> > That's fine, if there is a de facto standard to use, we can go for it.
>
> Looking at the option documentation gcc supports a lot of different possible
> ways and the warning option can change what is selected.
>
> Do we allow all that gcc allows? I hope not.
>

As with other things we should provide a portable way to maintain it.
I would suggest adding to basedefs.h:
#define RTEMS_CASE_FALL_THROUGH
macro as reasonably simple. We can debate a few variations
RTEMS_CASE_FALLTHRU is short and sufficient.

Most likely we'll never have to change it, but this will simplify code
review and avoid typos /* fall-trough */

> Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH 0/3] Fix Missing break in switch Coverity issues

2021-03-08 Thread Chris Johns
On 6/3/21 6:04 am, Gedare Bloom wrote:
> On Fri, Mar 5, 2021 at 11:48 AM Sebastian Huber
>  wrote:
>>
>> On 05/03/2021 19:40, Joel Sherrill wrote:
>>
>>> On Fri, Mar 5, 2021, 12:25 PM Sebastian Huber
>>> >> > wrote:
>>>
>>> On 05/03/2021 16:27, Gedare Bloom wrote:
>>>
>>> > Should we add a macro for this, e.g., "RTEMS_CASE_NO_BREAK" so
>>> that we
>>> > can update them in future if needed for other tools?
>>> I would just pick a name which is understood by GCC, clang, and
>>> Coverity. I guess other tools will understand this or why did you
>>> buy them?
>>>
>>>
>>> Well we didn't pay for any of those but are you wanting a macro or
>>> just the comment?
>>
>> I would just use a comment which is understood by GCC, clang, and
>> Coverity. What does Linux use?
>>
> That's fine, if there is a de facto standard to use, we can go for it.

Looking at the option documentation gcc supports a lot of different possible
ways and the warning option can change what is selected.

Do we allow all that gcc allows? I hope not.

Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH 0/3] Fix Missing break in switch Coverity issues

2021-03-05 Thread Gedare Bloom
On Fri, Mar 5, 2021 at 11:48 AM Sebastian Huber
 wrote:
>
> On 05/03/2021 19:40, Joel Sherrill wrote:
>
> > On Fri, Mar 5, 2021, 12:25 PM Sebastian Huber
> >  > > wrote:
> >
> > On 05/03/2021 16:27, Gedare Bloom wrote:
> >
> > > Should we add a macro for this, e.g., "RTEMS_CASE_NO_BREAK" so
> > that we
> > > can update them in future if needed for other tools?
> > I would just pick a name which is understood by GCC, clang, and
> > Coverity. I guess other tools will understand this or why did you
> > buy them?
> >
> >
> > Well we didn't pay for any of those but are you wanting a macro or
> > just the comment?
>
> I would just use a comment which is understood by GCC, clang, and
> Coverity. What does Linux use?
>
That's fine, if there is a de facto standard to use, we can go for it.

> --
> embedded brains GmbH
> Herr Sebastian HUBER
> Dornierstr. 4
> 82178 Puchheim
> Germany
> email: sebastian.hu...@embedded-brains.de
> phone: +49-89-18 94 741 - 16
> fax:   +49-89-18 94 741 - 08
>
> Registergericht: Amtsgericht München
> Registernummer: HRB 157899
> Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
> Unsere Datenschutzerklärung finden Sie hier:
> https://embedded-brains.de/datenschutzerklaerung/
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH 0/3] Fix Missing break in switch Coverity issues

2021-03-05 Thread Sebastian Huber

On 05/03/2021 19:40, Joel Sherrill wrote:

On Fri, Mar 5, 2021, 12:25 PM Sebastian Huber 
> wrote:


On 05/03/2021 16:27, Gedare Bloom wrote:

> Should we add a macro for this, e.g., "RTEMS_CASE_NO_BREAK" so
that we
> can update them in future if needed for other tools?
I would just pick a name which is understood by GCC, clang, and
Coverity. I guess other tools will understand this or why did you
buy them?


Well we didn't pay for any of those but are you wanting a macro or 
just the comment?


I would just use a comment which is understood by GCC, clang, and 
Coverity. What does Linux use?


--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH 0/3] Fix Missing break in switch Coverity issues

2021-03-05 Thread Joel Sherrill
On Fri, Mar 5, 2021, 12:25 PM Sebastian Huber <
sebastian.hu...@embedded-brains.de> wrote:

> On 05/03/2021 16:27, Gedare Bloom wrote:
>
> > Should we add a macro for this, e.g., "RTEMS_CASE_NO_BREAK" so that we
> > can update them in future if needed for other tools?
> I would just pick a name which is understood by GCC, clang, and
> Coverity. I guess other tools will understand this or why did you buy them?
>

Well we didn't pay for any of those but are you wanting a macro or just the
comment?

>
> --
> embedded brains GmbH
> Herr Sebastian HUBER
> Dornierstr. 4
> 82178 Puchheim
> Germany
> email: sebastian.hu...@embedded-brains.de
> phone: +49-89-18 94 741 - 16
> fax:   +49-89-18 94 741 - 08
>
> Registergericht: Amtsgericht München
> Registernummer: HRB 157899
> Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
> Unsere Datenschutzerklärung finden Sie hier:
> https://embedded-brains.de/datenschutzerklaerung/
>
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH 0/3] Fix Missing break in switch Coverity issues

2021-03-05 Thread Sebastian Huber

On 05/03/2021 16:27, Gedare Bloom wrote:


Should we add a macro for this, e.g., "RTEMS_CASE_NO_BREAK" so that we
can update them in future if needed for other tools?
I would just pick a name which is understood by GCC, clang, and 
Coverity. I guess other tools will understand this or why did you buy them?


--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH 0/3] Fix Missing break in switch Coverity issues

2021-03-05 Thread Gedare Bloom
Should we add a macro for this, e.g., "RTEMS_CASE_NO_BREAK" so that we
can update them in future if needed for other tools?

Regardless of the addition of a macro these are fine, the grlib one
came through separately I think. But I'd like to see a macro proposed.

On Wed, Mar 3, 2021 at 2:26 PM Ryan Long  wrote:
>
> Hi,
>
> To fix these Coverity issues, I just needed to add a comment to tell
> Coverity to ignore the error. I did this using the same method as shown
> in this article
> https://www.synopsys.com/blogs/software-security/gimme-a-break/.
>
> Thanks,
> Ryan
>
> Ryan Long (3):
>   grtc.c: Fix four Missing break in switch Coverity errors
>   cpuusagetop.c: Fix three Missing break in switch Coverity errors
>   pci_cfg_read.c: Fix Missing break in switch (CID #1399723)
>
>  bsps/shared/grlib/tmtc/grtc.c   | 4 
>  cpukit/libmisc/cpuuse/cpuusagetop.c | 3 +++
>  cpukit/libpci/pci_cfg_read.c| 1 +
>  3 files changed, 8 insertions(+)
>
> --
> 1.8.3.1
>
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel