Message ID | 1426196206-12813-1-git-send-email-bill.fischofer@linaro.org |
---|---|
State | Accepted |
Commit | 4699e036c2834d7be14a114df7e82f092a324568 |
Headers | show |
This patch removes nearly all the warnings, I observed one straggler though In file included from ../../platform/linux-generic/include/odp/init.h:28: ../../include/odp/api/init.h:121:9: warning: empty struct has size 0 in C, size 1 in C++ [-Wextern-c-compat] typedef struct odp_platform_init_t { my procedure:- ./bootstrap ./configure --enable-test-perf --enable-test-vald --enable-test-cpp make clean make CXX=clang++ On 12 March 2015 at 17:36, Bill Fischofer <bill.fischofer@linaro.org> wrote: > C++ doesn't like null structs so add a dummy variable to make it happy. > Note that we only use these types as pseudo-pointers for strong typing > so the contents of what they apparently point to is irrelevant since > we never reference it. > > This addresses Bug https://bugs.linaro.org/show_bug.cgi?id=1267 > > Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> > --- > platform/linux-generic/include/odp/plat/strong_types.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/platform/linux-generic/include/odp/plat/strong_types.h > b/platform/linux-generic/include/odp/plat/strong_types.h > index 7fe73d8..72db7c4 100644 > --- a/platform/linux-generic/include/odp/plat/strong_types.h > +++ b/platform/linux-generic/include/odp/plat/strong_types.h > @@ -16,7 +16,7 @@ > #define STRONG_TYPES_H_ > > /** Use strong typing for ODP types */ > -#define odp_handle_t struct {} * > +#define odp_handle_t struct { uint8_t unused_dummy_var; } * > > /** Internal macro to get value of an ODP handle */ > #define _odp_typeval(handle) ((uint32_t)(uintptr_t)(handle)) > -- > 2.1.0 > >
Ok, thanks. I'll look into that. Bill On Fri, Mar 13, 2015 at 2:04 PM, Mike Holmes <mike.holmes@linaro.org> wrote: > This patch removes nearly all the warnings, I observed one straggler though > > In file included from ../../platform/linux-generic/include/odp/init.h:28: > ../../include/odp/api/init.h:121:9: warning: empty struct has size 0 in C, > size 1 in C++ [-Wextern-c-compat] > typedef struct odp_platform_init_t { > > my procedure:- > > ./bootstrap > ./configure --enable-test-perf --enable-test-vald --enable-test-cpp > make clean > make CXX=clang++ > > > On 12 March 2015 at 17:36, Bill Fischofer <bill.fischofer@linaro.org> > wrote: > >> C++ doesn't like null structs so add a dummy variable to make it happy. >> Note that we only use these types as pseudo-pointers for strong typing >> so the contents of what they apparently point to is irrelevant since >> we never reference it. >> >> This addresses Bug https://bugs.linaro.org/show_bug.cgi?id=1267 >> >> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> >> --- >> platform/linux-generic/include/odp/plat/strong_types.h | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/platform/linux-generic/include/odp/plat/strong_types.h >> b/platform/linux-generic/include/odp/plat/strong_types.h >> index 7fe73d8..72db7c4 100644 >> --- a/platform/linux-generic/include/odp/plat/strong_types.h >> +++ b/platform/linux-generic/include/odp/plat/strong_types.h >> @@ -16,7 +16,7 @@ >> #define STRONG_TYPES_H_ >> >> /** Use strong typing for ODP types */ >> -#define odp_handle_t struct {} * >> +#define odp_handle_t struct { uint8_t unused_dummy_var; } * >> >> /** Internal macro to get value of an ODP handle */ >> #define _odp_typeval(handle) ((uint32_t)(uintptr_t)(handle)) >> -- >> 2.1.0 >> >> > > > -- > Mike Holmes > Technical Manager - Linaro Networking Group > Linaro.org <http://www.linaro.org/> *│ *Open source software for ARM SoCs > > >
It looks like that API file intentionally has an empty struct as a placeholder: /** ODP platform initialization data. * @note ODP API does nothing with this data. It is the underlying * implementation that requires it and any data passed here is not portable. * It is required that the application takes care of identifying and * passing any required platform specific data. */ typedef struct odp_platform_init_t { } odp_platform_init_t; Since it is an API file we shouldn't change this without Petri's involvement and in any event its a separate issue from the strong type one which covers the bulk of these warnings. My suggestion would be to go with this linux-generic patch for now and then perhaps pick up an API patch to cover the latter warning as part of v1.1. Make sense? On Fri, Mar 13, 2015 at 2:10 PM, Bill Fischofer <bill.fischofer@linaro.org> wrote: > Ok, thanks. I'll look into that. > > Bill > > On Fri, Mar 13, 2015 at 2:04 PM, Mike Holmes <mike.holmes@linaro.org> > wrote: > >> This patch removes nearly all the warnings, I observed one straggler >> though >> >> In file included from ../../platform/linux-generic/include/odp/init.h:28: >> ../../include/odp/api/init.h:121:9: warning: empty struct has size 0 in >> C, size 1 in C++ [-Wextern-c-compat] >> typedef struct odp_platform_init_t { >> >> my procedure:- >> >> ./bootstrap >> ./configure --enable-test-perf --enable-test-vald --enable-test-cpp >> make clean >> make CXX=clang++ >> >> >> On 12 March 2015 at 17:36, Bill Fischofer <bill.fischofer@linaro.org> >> wrote: >> >>> C++ doesn't like null structs so add a dummy variable to make it happy. >>> Note that we only use these types as pseudo-pointers for strong typing >>> so the contents of what they apparently point to is irrelevant since >>> we never reference it. >>> >>> This addresses Bug https://bugs.linaro.org/show_bug.cgi?id=1267 >>> >>> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> >>> --- >>> platform/linux-generic/include/odp/plat/strong_types.h | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/platform/linux-generic/include/odp/plat/strong_types.h >>> b/platform/linux-generic/include/odp/plat/strong_types.h >>> index 7fe73d8..72db7c4 100644 >>> --- a/platform/linux-generic/include/odp/plat/strong_types.h >>> +++ b/platform/linux-generic/include/odp/plat/strong_types.h >>> @@ -16,7 +16,7 @@ >>> #define STRONG_TYPES_H_ >>> >>> /** Use strong typing for ODP types */ >>> -#define odp_handle_t struct {} * >>> +#define odp_handle_t struct { uint8_t unused_dummy_var; } * >>> >>> /** Internal macro to get value of an ODP handle */ >>> #define _odp_typeval(handle) ((uint32_t)(uintptr_t)(handle)) >>> -- >>> 2.1.0 >>> >>> >> >> >> -- >> Mike Holmes >> Technical Manager - Linaro Networking Group >> Linaro.org <http://www.linaro.org/> *│ *Open source software for ARM SoCs >> >> >> >
On 13 March 2015 at 15:17, Bill Fischofer <bill.fischofer@linaro.org> wrote: > It looks like that API file intentionally has an empty struct as a > placeholder: > > /** ODP platform initialization data. > * @note ODP API does nothing with this data. It is the underlying > * implementation that requires it and any data passed here is not > portable. > * It is required that the application takes care of identifying and > * passing any required platform specific data. > */ > > typedef struct odp_platform_init_t { > } odp_platform_init_t; > > Since it is an API file we shouldn't change this without Petri's > involvement and in any event its a separate issue from the strong type one > which covers the bulk of these warnings. My suggestion would be to go with > this linux-generic patch for now and then perhaps pick up an API patch to > cover the latter warning as part of v1.1. > > Make sense? > Sounds good to me, I will create a bug for the new issue. > > On Fri, Mar 13, 2015 at 2:10 PM, Bill Fischofer <bill.fischofer@linaro.org > > wrote: > >> Ok, thanks. I'll look into that. >> >> Bill >> >> On Fri, Mar 13, 2015 at 2:04 PM, Mike Holmes <mike.holmes@linaro.org> >> wrote: >> >>> This patch removes nearly all the warnings, I observed one straggler >>> though >>> >>> In file included from ../../platform/linux-generic/include/odp/init.h:28: >>> ../../include/odp/api/init.h:121:9: warning: empty struct has size 0 in >>> C, size 1 in C++ [-Wextern-c-compat] >>> typedef struct odp_platform_init_t { >>> >>> my procedure:- >>> >>> ./bootstrap >>> ./configure --enable-test-perf --enable-test-vald --enable-test-cpp >>> make clean >>> make CXX=clang++ >>> >>> >>> On 12 March 2015 at 17:36, Bill Fischofer <bill.fischofer@linaro.org> >>> wrote: >>> >>>> C++ doesn't like null structs so add a dummy variable to make it happy. >>>> Note that we only use these types as pseudo-pointers for strong typing >>>> so the contents of what they apparently point to is irrelevant since >>>> we never reference it. >>>> >>>> This addresses Bug https://bugs.linaro.org/show_bug.cgi?id=1267 >>>> >>>> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> >>>> --- >>>> platform/linux-generic/include/odp/plat/strong_types.h | 2 +- >>>> 1 file changed, 1 insertion(+), 1 deletion(-) >>>> >>>> diff --git a/platform/linux-generic/include/odp/plat/strong_types.h >>>> b/platform/linux-generic/include/odp/plat/strong_types.h >>>> index 7fe73d8..72db7c4 100644 >>>> --- a/platform/linux-generic/include/odp/plat/strong_types.h >>>> +++ b/platform/linux-generic/include/odp/plat/strong_types.h >>>> @@ -16,7 +16,7 @@ >>>> #define STRONG_TYPES_H_ >>>> >>>> /** Use strong typing for ODP types */ >>>> -#define odp_handle_t struct {} * >>>> +#define odp_handle_t struct { uint8_t unused_dummy_var; } * >>>> >>>> /** Internal macro to get value of an ODP handle */ >>>> #define _odp_typeval(handle) ((uint32_t)(uintptr_t)(handle)) >>>> -- >>>> 2.1.0 >>>> >>>> >>> >>> >>> -- >>> Mike Holmes >>> Technical Manager - Linaro Networking Group >>> Linaro.org <http://www.linaro.org/> *│ *Open source software for ARM >>> SoCs >>> >>> >>> >> > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > http://lists.linaro.org/mailman/listinfo/lng-odp > >
On 12 March 2015 at 17:36, Bill Fischofer <bill.fischofer@linaro.org> wrote: > C++ doesn't like null structs so add a dummy variable to make it happy. > Note that we only use these types as pseudo-pointers for strong typing > so the contents of what they apparently point to is irrelevant since > we never reference it. > > This addresses Bug https://bugs.linaro.org/show_bug.cgi?id=1267 > > Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> > Reviewed-and-tested-by: Mike Holmes <mike.holmes@linaro.org> > --- > platform/linux-generic/include/odp/plat/strong_types.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/platform/linux-generic/include/odp/plat/strong_types.h > b/platform/linux-generic/include/odp/plat/strong_types.h > index 7fe73d8..72db7c4 100644 > --- a/platform/linux-generic/include/odp/plat/strong_types.h > +++ b/platform/linux-generic/include/odp/plat/strong_types.h > @@ -16,7 +16,7 @@ > #define STRONG_TYPES_H_ > > /** Use strong typing for ODP types */ > -#define odp_handle_t struct {} * > +#define odp_handle_t struct { uint8_t unused_dummy_var; } * > > /** Internal macro to get value of an ODP handle */ > #define _odp_typeval(handle) ((uint32_t)(uintptr_t)(handle)) > -- > 2.1.0 > >
Merged, Maxim. On 03/13/15 22:29, Mike Holmes wrote: > > > On 12 March 2015 at 17:36, Bill Fischofer <bill.fischofer@linaro.org > <mailto:bill.fischofer@linaro.org>> wrote: > > C++ doesn't like null structs so add a dummy variable to make it > happy. > Note that we only use these types as pseudo-pointers for strong typing > so the contents of what they apparently point to is irrelevant since > we never reference it. > > This addresses Bug https://bugs.linaro.org/show_bug.cgi?id=1267 > > Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org > <mailto:bill.fischofer@linaro.org>> > > > Reviewed-and-tested-by: Mike Holmes <mike.holmes@linaro.org > <mailto:mike.holmes@linaro.org>> > > --- > platform/linux-generic/include/odp/plat/strong_types.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git > a/platform/linux-generic/include/odp/plat/strong_types.h > b/platform/linux-generic/include/odp/plat/strong_types.h > index 7fe73d8..72db7c4 100644 > --- a/platform/linux-generic/include/odp/plat/strong_types.h > +++ b/platform/linux-generic/include/odp/plat/strong_types.h > @@ -16,7 +16,7 @@ > #define STRONG_TYPES_H_ > > /** Use strong typing for ODP types */ > -#define odp_handle_t struct {} * > +#define odp_handle_t struct { uint8_t unused_dummy_var; } * > > /** Internal macro to get value of an ODP handle */ > #define _odp_typeval(handle) ((uint32_t)(uintptr_t)(handle)) > -- > 2.1.0 > > > > > -- > Mike Holmes > Technical Manager - Linaro Networking Group > Linaro.org <http://www.linaro.org/>***│ *Open source software for ARM SoCs > > > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > http://lists.linaro.org/mailman/listinfo/lng-odp
diff --git a/platform/linux-generic/include/odp/plat/strong_types.h b/platform/linux-generic/include/odp/plat/strong_types.h index 7fe73d8..72db7c4 100644 --- a/platform/linux-generic/include/odp/plat/strong_types.h +++ b/platform/linux-generic/include/odp/plat/strong_types.h @@ -16,7 +16,7 @@ #define STRONG_TYPES_H_ /** Use strong typing for ODP types */ -#define odp_handle_t struct {} * +#define odp_handle_t struct { uint8_t unused_dummy_var; } * /** Internal macro to get value of an ODP handle */ #define _odp_typeval(handle) ((uint32_t)(uintptr_t)(handle))
C++ doesn't like null structs so add a dummy variable to make it happy. Note that we only use these types as pseudo-pointers for strong typing so the contents of what they apparently point to is irrelevant since we never reference it. This addresses Bug https://bugs.linaro.org/show_bug.cgi?id=1267 Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> --- platform/linux-generic/include/odp/plat/strong_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)