[PATCH 11/12] sim/testsuite/cris: Remove faulty use of basename in C tests
Hans-Peter Nilsson
hp@axis.com
Wed Feb 16 06:44:00 GMT 2022
> Date: Tue, 15 Feb 2022 23:57:00 -0500
> From: Mike Frysinger <vapier@gentoo.org>
> On 15 Feb 2022 00:07, Hans-Peter Nilsson via Gdb-patches wrote:
> > --- a/sim/testsuite/cris/c/stat3.c
> > +++ b/sim/testsuite/cris/c/stat3.c
> > @@ -7,13 +7,14 @@
> > #include <stdio.h>
> > #include <string.h>
> > #include <stdlib.h>
> > +#define mybasename(x) ({ const char *x_ = (x), *y_ = strrchr (x_, '/'); y_ != NULL ? y_ + 1 : x_; })
> >
> > int main (int argc, char *argv[])
> > {
> > char path[1024] = "/";
> > struct stat buf;
> >
> > - strcat (path, basename (argv[0]));
> > + strcat (path, mybasename(argv[0]));
>
> GNU style (and this file style) says to put space before the (
> -mike
Now that's a nit if ever I saw one; it's in the test-suite!
Committed.
--- 8< ---
sim/testsuite/cris/c/stat3.c: Fix formatting nit
* c/stat3.c (main): Fix formatting nit.
---
sim/testsuite/cris/c/stat3.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sim/testsuite/cris/c/stat3.c b/sim/testsuite/cris/c/stat3.c
index f7c96045832c..321da1b2bd61 100644
--- a/sim/testsuite/cris/c/stat3.c
+++ b/sim/testsuite/cris/c/stat3.c
@@ -14,7 +14,7 @@ int main (int argc, char *argv[])
char path[1024] = "/";
struct stat buf;
- strcat (path, mybasename(argv[0]));
+ strcat (path, mybasename (argv[0]));
if (stat (".", &buf) != 0
|| !S_ISDIR (buf.st_mode))
abort ();
--
2.30.2
More information about the Gdb-patches
mailing list