diff mbox

[v2] fix including odp_std_types.h

Message ID 1415048037-6416-1-git-send-email-mike.holmes@linaro.org
State Rejected
Headers show

Commit Message

Mike Holmes Nov. 3, 2014, 8:53 p.m. UTC
API headers should not include C std lib headers directly

Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
---

v2:
remove endian.h it should be cleaned up during configuration / build

 platform/linux-generic/include/api/odp_debug.h     | 3 +--
 platform/linux-generic/include/api/odp_std_types.h | 2 ++
 2 files changed, 3 insertions(+), 2 deletions(-)

Comments

Ciprian Barbu Nov. 4, 2014, 3:14 p.m. UTC | #1
Do we still worry about Petri's comment? Right now
platform/linux-generic/include/api/odp_byteorder.h includes endian.h.
Anyway that should be the subject of a different patch so I think this
can go in.

On Mon, Nov 3, 2014 at 10:53 PM, Mike Holmes <mike.holmes@linaro.org> wrote:
> API headers should not include C std lib headers directly
>
> Signed-off-by: Mike Holmes <mike.holmes@linaro.org>

Reviewed-and-tested-by: Ciprian Barbu <ciprian.barbu@linaro.org>

> ---
>
> v2:
> remove endian.h it should be cleaned up during configuration / build
>
>  platform/linux-generic/include/api/odp_debug.h     | 3 +--
>  platform/linux-generic/include/api/odp_std_types.h | 2 ++
>  2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/platform/linux-generic/include/api/odp_debug.h b/platform/linux-generic/include/api/odp_debug.h
> index c9b2edd..99f4574 100644
> --- a/platform/linux-generic/include/api/odp_debug.h
> +++ b/platform/linux-generic/include/api/odp_debug.h
> @@ -12,8 +12,7 @@
>  #ifndef ODP_DEBUG_H_
>  #define ODP_DEBUG_H_
>
> -#include <stdio.h>
> -#include <stdlib.h>
> +#include <odp_std_types.h>
>
>  #ifdef __cplusplus
>  extern "C" {
> diff --git a/platform/linux-generic/include/api/odp_std_types.h b/platform/linux-generic/include/api/odp_std_types.h
> index b12a2f3..e3aa5ab 100644
> --- a/platform/linux-generic/include/api/odp_std_types.h
> +++ b/platform/linux-generic/include/api/odp_std_types.h
> @@ -26,6 +26,8 @@ extern "C" {
>  #include <stdint.h>
>  #include <inttypes.h>
>  #include <limits.h>
> +#include <stdio.h>
> +#include <stdlib.h>
>
>
>
> --
> 2.1.0
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
Savolainen, Petri (NSN - FI/Espoo) Nov. 5, 2014, 11:44 a.m. UTC | #2
The thing is that odp_std_types.h should include C standard header, nothing else. Endian.h should not be included all over the place (through odp_std_types.h).

-Petri

> -----Original Message-----
> From: lng-odp-bounces@lists.linaro.org [mailto:lng-odp-
> bounces@lists.linaro.org] On Behalf Of ext Ciprian Barbu
> Sent: Tuesday, November 04, 2014 5:15 PM
> To: Mike Holmes
> Cc: lng-odp
> Subject: Re: [lng-odp] [PATCH v2] fix including odp_std_types.h
> 
> Do we still worry about Petri's comment? Right now
> platform/linux-generic/include/api/odp_byteorder.h includes endian.h.
> Anyway that should be the subject of a different patch so I think this
> can go in.
> 
> On Mon, Nov 3, 2014 at 10:53 PM, Mike Holmes <mike.holmes@linaro.org>
> wrote:
> > API headers should not include C std lib headers directly
> >
> > Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
> 
> Reviewed-and-tested-by: Ciprian Barbu <ciprian.barbu@linaro.org>
> 
> > ---
> >
> > v2:
> > remove endian.h it should be cleaned up during configuration / build
> >
> >  platform/linux-generic/include/api/odp_debug.h     | 3 +--
> >  platform/linux-generic/include/api/odp_std_types.h | 2 ++
> >  2 files changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/platform/linux-generic/include/api/odp_debug.h
> b/platform/linux-generic/include/api/odp_debug.h
> > index c9b2edd..99f4574 100644
> > --- a/platform/linux-generic/include/api/odp_debug.h
> > +++ b/platform/linux-generic/include/api/odp_debug.h
> > @@ -12,8 +12,7 @@
> >  #ifndef ODP_DEBUG_H_
> >  #define ODP_DEBUG_H_
> >
> > -#include <stdio.h>
> > -#include <stdlib.h>
> > +#include <odp_std_types.h>
> >
> >  #ifdef __cplusplus
> >  extern "C" {
> > diff --git a/platform/linux-generic/include/api/odp_std_types.h
> b/platform/linux-generic/include/api/odp_std_types.h
> > index b12a2f3..e3aa5ab 100644
> > --- a/platform/linux-generic/include/api/odp_std_types.h
> > +++ b/platform/linux-generic/include/api/odp_std_types.h
> > @@ -26,6 +26,8 @@ extern "C" {
> >  #include <stdint.h>
> >  #include <inttypes.h>
> >  #include <limits.h>
> > +#include <stdio.h>
> > +#include <stdlib.h>
> >
> >
> >
> > --
> > 2.1.0
> >
> >
> > _______________________________________________
> > lng-odp mailing list
> > lng-odp@lists.linaro.org
> > http://lists.linaro.org/mailman/listinfo/lng-odp
> 
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
diff mbox

Patch

diff --git a/platform/linux-generic/include/api/odp_debug.h b/platform/linux-generic/include/api/odp_debug.h
index c9b2edd..99f4574 100644
--- a/platform/linux-generic/include/api/odp_debug.h
+++ b/platform/linux-generic/include/api/odp_debug.h
@@ -12,8 +12,7 @@ 
 #ifndef ODP_DEBUG_H_
 #define ODP_DEBUG_H_
 
-#include <stdio.h>
-#include <stdlib.h>
+#include <odp_std_types.h>
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/platform/linux-generic/include/api/odp_std_types.h b/platform/linux-generic/include/api/odp_std_types.h
index b12a2f3..e3aa5ab 100644
--- a/platform/linux-generic/include/api/odp_std_types.h
+++ b/platform/linux-generic/include/api/odp_std_types.h
@@ -26,6 +26,8 @@  extern "C" {
 #include <stdint.h>
 #include <inttypes.h>
 #include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>