public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/zack/no-nested-includes] Don't include sys/types.h 7/n: Linux misc
@ 2019-06-18 15:35 Zack Weinberg
  0 siblings, 0 replies; 2+ messages in thread
From: Zack Weinberg @ 2019-06-18 15:35 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=7745a3e5bcdec44a82dae5dd7897eef8ebfde605

commit 7745a3e5bcdec44a82dae5dd7897eef8ebfde605
Author: Zack Weinberg <zackw@panix.com>
Date:   Sun May 26 12:08:40 2019 -0400

    Don't include sys/types.h 7/n: Linux misc
    
    These headers only have Linux-specific incarnations and can easily
    avoid including sys/types.h.
    
    	* sysdeps/unix/sysv/linux/alpha/sys/acct.h: Style fix.
    	* sysdeps/unix/sysv/linux/sys/acct.h: Include features.h
    	and bits/stdint-uintn.h.  Don't include sys/types.h, stdint.h,
    	or bits/types/time_t.h.
    
    	* sysdeps/unix/sysv/linux/sys/fsuid.h
    	* sysdeps/unix/sysv/linux/sys/quota.h
    	Include bits/types.h, not sys/types.h.
    
    	* scripts/check-obsolete-constructs.py (HEADER_ALLOWED_INCLUDES):
    	Update.

Diff:
---
 scripts/check-obsolete-constructs.py     | 3 ---
 sysdeps/unix/sysv/linux/alpha/sys/acct.h | 2 +-
 sysdeps/unix/sysv/linux/sys/acct.h       | 6 +++---
 sysdeps/unix/sysv/linux/sys/fsuid.h      | 2 +-
 sysdeps/unix/sysv/linux/sys/quota.h      | 2 +-
 5 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/scripts/check-obsolete-constructs.py b/scripts/check-obsolete-constructs.py
index f9121ab..e2b6b5f 100755
--- a/scripts/check-obsolete-constructs.py
+++ b/scripts/check-obsolete-constructs.py
@@ -589,7 +589,6 @@ HEADER_ALLOWED_INCLUDES = {
     "wait.h":                      [ "sys/wait.h" ],
 
     # Nonstandardized sys/ headers
-    "sys/acct.h":                  [ "endian.h", "stdint.h", "sys/types.h" ],
     "sys/auxv.h":                  [ "elf.h" ],
     "sys/bitypes.h":               [ "sys/types.h" ],
     "sys/dir.h":                   [ "dirent.h" ],
@@ -599,7 +598,6 @@ HEADER_ALLOWED_INCLUDES = {
     "sys/fanotify.h":              [ "stdint.h" ],
     "sys/fcntl.h":                 [ "fcntl.h" ],
     "sys/file.h":                  [ "fcntl.h" ],
-    "sys/fsuid.h":                 [ "sys/types.h" ],
     "sys/inotify.h":               [ "stdint.h" ],
     "sys/ioctl.h":                 [ "sys/ttydefaults.h" ],
     "sys/mount.h":                 [ "sys/ioctl.h" ],
@@ -610,7 +608,6 @@ HEADER_ALLOWED_INCLUDES = {
     "sys/procfs.h":                [ "sys/time.h", "sys/types.h",
                                      "sys/user.h" ],
     "sys/ptrace.h":                [ "sys/ucontext.h" ],
-    "sys/quota.h":                 [ "sys/types.h" ],
     "sys/raw.h":                   [ "stdint.h", "sys/ioctl.h" ],
     "sys/signal.h":                [ "signal.h" ],
     "sys/signalfd.h":              [ "stdint.h" ],
diff --git a/sysdeps/unix/sysv/linux/alpha/sys/acct.h b/sysdeps/unix/sysv/linux/alpha/sys/acct.h
index 95e5b86..98c92ed 100644
--- a/sysdeps/unix/sysv/linux/alpha/sys/acct.h
+++ b/sysdeps/unix/sysv/linux/alpha/sys/acct.h
@@ -16,8 +16,8 @@
    <http://www.gnu.org/licenses/>.  */
 
 #ifndef _SYS_ACCT_H
-
 #define _SYS_ACCT_H	1
+
 #include <features.h>
 
 #include <bits/types/time_t.h>
diff --git a/sysdeps/unix/sysv/linux/sys/acct.h b/sysdeps/unix/sysv/linux/sys/acct.h
index 4c119da..515045b 100644
--- a/sysdeps/unix/sysv/linux/sys/acct.h
+++ b/sysdeps/unix/sysv/linux/sys/acct.h
@@ -18,10 +18,10 @@
 #ifndef _SYS_ACCT_H
 #define _SYS_ACCT_H	1
 
-#include <sys/types.h>
-#include <stdint.h>
+#include <features.h>
+
 #include <bits/endian.h>
-#include <bits/types/time_t.h>
+#include <bits/stdint-uintn.h>
 
 __BEGIN_DECLS
 
diff --git a/sysdeps/unix/sysv/linux/sys/fsuid.h b/sysdeps/unix/sysv/linux/sys/fsuid.h
index 54bd2d9..054d20c 100644
--- a/sysdeps/unix/sysv/linux/sys/fsuid.h
+++ b/sysdeps/unix/sysv/linux/sys/fsuid.h
@@ -19,7 +19,7 @@
 #define _SYS_FSUID_H	1
 
 #include <features.h>
-#include <sys/types.h>
+#include <bits/types.h>
 
 __BEGIN_DECLS
 
diff --git a/sysdeps/unix/sysv/linux/sys/quota.h b/sysdeps/unix/sysv/linux/sys/quota.h
index 8c3a5a1..cf55f48 100644
--- a/sysdeps/unix/sysv/linux/sys/quota.h
+++ b/sysdeps/unix/sysv/linux/sys/quota.h
@@ -52,8 +52,8 @@
 #define _SYS_QUOTA_H 1
 
 #include <features.h>
-#include <sys/types.h>
 
+#include <bits/types.h>
 #include <linux/quota.h>
 
 /*


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

* [glibc/zack/no-nested-includes] Don't include sys/types.h 7/n: Linux misc
@ 2019-05-26 16:37 Zack Weinberg
  0 siblings, 0 replies; 2+ messages in thread
From: Zack Weinberg @ 2019-05-26 16:37 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=bea480d688bd535ea0170c980753c53baa9f8f4c

commit bea480d688bd535ea0170c980753c53baa9f8f4c
Author: Zack Weinberg <zackw@panix.com>
Date:   Sun May 26 12:08:40 2019 -0400

    Don't include sys/types.h 7/n: Linux misc
    
    These headers only have Linux-specific incarnations and can easily
    avoid including sys/types.h.
    
    	* sysdeps/unix/sysv/linux/alpha/sys/acct.h: Style fix.
    	* sysdeps/unix/sysv/linux/sys/acct.h: Include features.h
    	and bits/stdint-uintn.h.  Don't include sys/types.h, stdint.h,
    	or bits/types/time_t.h.
    
    	* sysdeps/unix/sysv/linux/sys/fsuid.h
    	* sysdeps/unix/sysv/linux/sys/quota.h
    	Include bits/types.h, not sys/types.h.
    
    	* scripts/check-obsolete-constructs.py (HEADER_ALLOWED_INCLUDES):
    	Update.

Diff:
---
 scripts/check-obsolete-constructs.py     | 3 ---
 sysdeps/unix/sysv/linux/alpha/sys/acct.h | 2 +-
 sysdeps/unix/sysv/linux/sys/acct.h       | 6 +++---
 sysdeps/unix/sysv/linux/sys/fsuid.h      | 2 +-
 sysdeps/unix/sysv/linux/sys/quota.h      | 2 +-
 5 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/scripts/check-obsolete-constructs.py b/scripts/check-obsolete-constructs.py
index f9121ab..e2b6b5f 100755
--- a/scripts/check-obsolete-constructs.py
+++ b/scripts/check-obsolete-constructs.py
@@ -589,7 +589,6 @@ HEADER_ALLOWED_INCLUDES = {
     "wait.h":                      [ "sys/wait.h" ],
 
     # Nonstandardized sys/ headers
-    "sys/acct.h":                  [ "endian.h", "stdint.h", "sys/types.h" ],
     "sys/auxv.h":                  [ "elf.h" ],
     "sys/bitypes.h":               [ "sys/types.h" ],
     "sys/dir.h":                   [ "dirent.h" ],
@@ -599,7 +598,6 @@ HEADER_ALLOWED_INCLUDES = {
     "sys/fanotify.h":              [ "stdint.h" ],
     "sys/fcntl.h":                 [ "fcntl.h" ],
     "sys/file.h":                  [ "fcntl.h" ],
-    "sys/fsuid.h":                 [ "sys/types.h" ],
     "sys/inotify.h":               [ "stdint.h" ],
     "sys/ioctl.h":                 [ "sys/ttydefaults.h" ],
     "sys/mount.h":                 [ "sys/ioctl.h" ],
@@ -610,7 +608,6 @@ HEADER_ALLOWED_INCLUDES = {
     "sys/procfs.h":                [ "sys/time.h", "sys/types.h",
                                      "sys/user.h" ],
     "sys/ptrace.h":                [ "sys/ucontext.h" ],
-    "sys/quota.h":                 [ "sys/types.h" ],
     "sys/raw.h":                   [ "stdint.h", "sys/ioctl.h" ],
     "sys/signal.h":                [ "signal.h" ],
     "sys/signalfd.h":              [ "stdint.h" ],
diff --git a/sysdeps/unix/sysv/linux/alpha/sys/acct.h b/sysdeps/unix/sysv/linux/alpha/sys/acct.h
index 95e5b86..98c92ed 100644
--- a/sysdeps/unix/sysv/linux/alpha/sys/acct.h
+++ b/sysdeps/unix/sysv/linux/alpha/sys/acct.h
@@ -16,8 +16,8 @@
    <http://www.gnu.org/licenses/>.  */
 
 #ifndef _SYS_ACCT_H
-
 #define _SYS_ACCT_H	1
+
 #include <features.h>
 
 #include <bits/types/time_t.h>
diff --git a/sysdeps/unix/sysv/linux/sys/acct.h b/sysdeps/unix/sysv/linux/sys/acct.h
index 4c119da..515045b 100644
--- a/sysdeps/unix/sysv/linux/sys/acct.h
+++ b/sysdeps/unix/sysv/linux/sys/acct.h
@@ -18,10 +18,10 @@
 #ifndef _SYS_ACCT_H
 #define _SYS_ACCT_H	1
 
-#include <sys/types.h>
-#include <stdint.h>
+#include <features.h>
+
 #include <bits/endian.h>
-#include <bits/types/time_t.h>
+#include <bits/stdint-uintn.h>
 
 __BEGIN_DECLS
 
diff --git a/sysdeps/unix/sysv/linux/sys/fsuid.h b/sysdeps/unix/sysv/linux/sys/fsuid.h
index 54bd2d9..054d20c 100644
--- a/sysdeps/unix/sysv/linux/sys/fsuid.h
+++ b/sysdeps/unix/sysv/linux/sys/fsuid.h
@@ -19,7 +19,7 @@
 #define _SYS_FSUID_H	1
 
 #include <features.h>
-#include <sys/types.h>
+#include <bits/types.h>
 
 __BEGIN_DECLS
 
diff --git a/sysdeps/unix/sysv/linux/sys/quota.h b/sysdeps/unix/sysv/linux/sys/quota.h
index 8c3a5a1..cf55f48 100644
--- a/sysdeps/unix/sysv/linux/sys/quota.h
+++ b/sysdeps/unix/sysv/linux/sys/quota.h
@@ -52,8 +52,8 @@
 #define _SYS_QUOTA_H 1
 
 #include <features.h>
-#include <sys/types.h>
 
+#include <bits/types.h>
 #include <linux/quota.h>
 
 /*


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

end of thread, other threads:[~2019-06-18 15:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-18 15:35 [glibc/zack/no-nested-includes] Don't include sys/types.h 7/n: Linux misc Zack Weinberg
  -- strict thread matches above, loose matches on Subject: below --
2019-05-26 16:37 Zack Weinberg

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 read-only IMAP folder(s) and NNTP newsgroup(s).