mailing list of musl libc
 help / color / mirror / code / Atom feed
* [PATCH] Add __intNN_t type definitions
@ 2018-01-12 17:07 Rostislav Skudnov
  2018-01-12 18:04 ` Markus Wichmann
  0 siblings, 1 reply; 3+ messages in thread
From: Rostislav Skudnov @ 2018-01-12 17:07 UTC (permalink / raw)
  To: musl

These types are defined in glibc headers and are used by some programs,
e. g. xfsprogs before version 4.13.0.
---
 include/sys/types.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/sys/types.h b/include/sys/types.h
index 75e489c..b02208d 100644
--- a/include/sys/types.h
+++ b/include/sys/types.h
@@ -56,6 +56,15 @@ extern "C" {
 
 #include <bits/alltypes.h>
 
+typedef signed char __int8_t;
+typedef unsigned char __uint8_t;
+typedef short __int16_t;
+typedef unsigned short __uint16_t;
+typedef int __int32_t;
+typedef unsigned int __uint32_t;
+typedef off_t __int64_t;
+typedef ino_t __uint64_t;
+
 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
 typedef unsigned char u_int8_t;
 typedef unsigned short u_int16_t;
-- 
2.1.4



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Add __intNN_t type definitions
  2018-01-12 17:07 [PATCH] Add __intNN_t type definitions Rostislav Skudnov
@ 2018-01-12 18:04 ` Markus Wichmann
  2018-01-12 19:26   ` Rich Felker
  0 siblings, 1 reply; 3+ messages in thread
From: Markus Wichmann @ 2018-01-12 18:04 UTC (permalink / raw)
  To: musl

On Fri, Jan 12, 2018 at 05:07:05PM +0000, Rostislav Skudnov wrote:
> These types are defined in glibc headers and are used by some programs,
> e. g. xfsprogs before version 4.13.0.

Then those programs are broken and have to be patched.

> ---
>  include/sys/types.h | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/include/sys/types.h b/include/sys/types.h
> index 75e489c..b02208d 100644
> --- a/include/sys/types.h
> +++ b/include/sys/types.h
> @@ -56,6 +56,15 @@ extern "C" {
>  
>  #include <bits/alltypes.h>
>  
> +typedef signed char __int8_t;
> +typedef unsigned char __uint8_t;
> +typedef short __int16_t;
> +typedef unsigned short __uint16_t;
> +typedef int __int32_t;
> +typedef unsigned int __uint32_t;
> +typedef off_t __int64_t;
> +typedef ino_t __uint64_t;
> +
>  #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
>  typedef unsigned char u_int8_t;
>  typedef unsigned short u_int16_t;
> -- 
> 2.1.4
> 

Names starting with two underscores (or one underscore and one capital
letter) are reserved for internal use by the implementation. Unless they
are specifically defined (like _Bool), they should not be used.

Ciao,
Markus


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Add __intNN_t type definitions
  2018-01-12 18:04 ` Markus Wichmann
@ 2018-01-12 19:26   ` Rich Felker
  0 siblings, 0 replies; 3+ messages in thread
From: Rich Felker @ 2018-01-12 19:26 UTC (permalink / raw)
  To: musl

On Fri, Jan 12, 2018 at 07:04:09PM +0100, Markus Wichmann wrote:
> On Fri, Jan 12, 2018 at 05:07:05PM +0000, Rostislav Skudnov wrote:
> > These types are defined in glibc headers and are used by some programs,
> > e. g. xfsprogs before version 4.13.0.
> 
> Then those programs are broken and have to be patched.
> 
> > ---
> >  include/sys/types.h | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> > 
> > diff --git a/include/sys/types.h b/include/sys/types.h
> > index 75e489c..b02208d 100644
> > --- a/include/sys/types.h
> > +++ b/include/sys/types.h
> > @@ -56,6 +56,15 @@ extern "C" {
> >  
> >  #include <bits/alltypes.h>
> >  
> > +typedef signed char __int8_t;
> > +typedef unsigned char __uint8_t;
> > +typedef short __int16_t;
> > +typedef unsigned short __uint16_t;
> > +typedef int __int32_t;
> > +typedef unsigned int __uint32_t;
> > +typedef off_t __int64_t;
> > +typedef ino_t __uint64_t;
> > +
> >  #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
> >  typedef unsigned char u_int8_t;
> >  typedef unsigned short u_int16_t;
> > -- 
> > 2.1.4
> > 
> 
> Names starting with two underscores (or one underscore and one capital
> letter) are reserved for internal use by the implementation. Unless they
> are specifically defined (like _Bool), they should not be used.

Yes, this is a known application bug and not usage we will support.
It's not like other cases where types or symbols that were
inadvertently named with leading underscores and entered common use,
which sometimes make sense to support if they're the only way to do
something. This is just applications gratuitously using the wrong name
when the right one exists alongside it.

Rich


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-01-12 19:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-12 17:07 [PATCH] Add __intNN_t type definitions Rostislav Skudnov
2018-01-12 18:04 ` Markus Wichmann
2018-01-12 19:26   ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).