[rtems commit] semopen.c: Address set but unused variable warning

Pavel Pisa ppisa4lists at pikron.com
Mon Sep 23 22:39:22 UTC 2013


On Monday 23 of September 2013 15:05:26 Joel Sherrill wrote:
> Does that work or generate an warning about statement with no effect?
>
> Gedare Bloom <gedare at rtems.org> wrote:
>
>
> On Sun, Sep 22, 2013 at 10:45 AM, Joel Sherrill
>
> <joel.sherrill at oarcorp.com> wrote:
> > There is precedence for using the compiler attributes
> > so I just added that and switched.
>
> I think it might be better to avoid compiler attributes when there is
> a language-level alternative that is compiler-agnostic. In this case,
> the use of:
> (void) var;
> seems fine to me.

Hello Joel and others,

it should work without warning. I have read more discussion
about confirming this and we use this solution in some of our code
where I do not like to introduce dependency on uLUt/other header.
But it worth to check that with even more toolchains version.

But I have slight personal preference for
RTEMS_COMPILER_UNUSED_ATTRIBUTE where it is available from
already included makefiles even that the define is quite long.

Best wishes,


            Pavel



More information about the devel mailing list