]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
ls: port to OpenBSD
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 3 Oct 2021 01:07:27 +0000 (18:07 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 3 Oct 2021 01:08:33 +0000 (18:08 -0700)
Problem reported by Brian Callahan (Bug#50972).
* src/ls.c (decode_switches): Don’t assume __GNUC_PREREQ.

src/ls.c

index 1047801e8423496741336acd5dc659965785a147..322affef4a4953efb14ae03a843fa42fecea7352 100644 (file)
--- a/src/ls.c
+++ b/src/ls.c
@@ -2273,7 +2273,7 @@ decode_switches (int argc, char **argv)
       if (linelen < 0)
         {
           /* Suppress bogus warning re comparing ws.ws_col to big integer.  */
-# if __GNUC_PREREQ (4, 6)
+# if 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
 #  pragma GCC diagnostic push
 #  pragma GCC diagnostic ignored "-Wtype-limits"
 # endif
@@ -2282,7 +2282,7 @@ decode_switches (int argc, char **argv)
               && 0 <= ioctl (STDOUT_FILENO, TIOCGWINSZ, &ws)
               && 0 < ws.ws_col)
             linelen = ws.ws_col <= MIN (PTRDIFF_MAX, SIZE_MAX) ? ws.ws_col : 0;
-# if __GNUC_PREREQ (4, 6)
+# if 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
 #  pragma GCC diagnostic pop
 # endif
         }