]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
regtest: fix compiler warnings with clang 16
authorPaul Floyd <pjfloyd@wanadoo.fr>
Sun, 27 Aug 2023 14:57:24 +0000 (16:57 +0200)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Sun, 27 Aug 2023 14:57:24 +0000 (16:57 +0200)
Mostly warnings about deprecated use of K&R function definitions.

drd/tests/dlopen_lib.c
memcheck/tests/vcpu_fbench.c
none/tests/unit_debuglog.c
perf/fbench.c
perf/ffbench.c

index ea18fc5439544aef3b25b183de03b2f1786d4d13..34d61676144196f143c2bb7963afff5585672681 100644 (file)
@@ -18,7 +18,7 @@ void foo()
   int rc;
   uintptr_t t = 1;
 
-  printf("In main: creating thread %ld\n", t);
+  printf("In main: creating thread %u\n", (unsigned)t);
   rc = pthread_create(&thread, NULL, PrintHello, (void *)t);
   if (rc)
     printf("ERROR; return code from pthread_create() is %d\n", rc);
index 6a7767d8cf3fc2da68f1b6896844930672904814..2f05eb86fd9251dce741cd16ddeac93d8843e266 100644 (file)
@@ -380,8 +380,7 @@ static double atanc[] = {
 
 /*  aint(x)      Return integer part of number.  Truncates towards 0    */
 
-double aint(x)
-double x;
+double aint(double x)
 {
        long l;
 
@@ -398,8 +397,7 @@ double x;
 
 /*  sin(x)       Return sine, x in radians  */
 
-static double sin(x)
-double x;
+static double sin(double x)
 {
        int sign;
        double y, r, z;
@@ -437,8 +435,7 @@ double x;
 
 /*  cos(x)       Return cosine, x in radians, by identity  */
 
-static double cos(x)
-double x;
+static double cos(double x)
 {
        x = (x < 0.0) ? -x : x;
        if (x > twopi)                /* Do range reduction here to limit */
@@ -448,8 +445,7 @@ double x;
 
 /*  tan(x)       Return tangent, x in radians, by identity  */
 
-static double tan(x)
-double x;
+static double tan(double x)
 {
        return sin(x) / cos(x);
 }
@@ -457,8 +453,7 @@ double x;
 /*  sqrt(x)      Return square root.  Initial guess, then Newton-
                  Raphson refinement  */
 
-double sqrt(x)
-double x;
+double sqrt(double x)
 {
        double c, cl, y;
        int n;
@@ -490,8 +485,7 @@ double x;
 /*  atan(x)      Return arctangent in radians,
                  range -pi/2 to pi/2  */
 
-static double atan(x)
-double x;
+static double atan(double x)
 {
        int sign, l, y;
        double a, b, z;
@@ -530,8 +524,7 @@ atl:
 /*  atan2(y,x)   Return arctangent in radians of y/x,
                  range -pi to pi  */
 
-static double atan2(y, x)
-double y, x;
+static double atan2(double y, double x)
 {
        double temp;
 
@@ -555,8 +548,7 @@ double y, x;
 
 /*  asin(x)      Return arcsine in radians of x  */
 
-static double asin(x)
-double x;
+static double asin(double x)
 {
        if (fabs(x)>1.0) {
           fprintf(stderr,
@@ -674,9 +666,7 @@ static void transit_surface() {
 
 /*  Perform ray trace in specific spectral line  */
 
-static void trace_line(line, ray_h)
-int line;
-double ray_h;
+static void trace_line(int line, double ray_h)
 {
        int i;
 
@@ -701,9 +691,7 @@ double ray_h;
 
 /*  Initialise when called the first time  */
 
-int main(argc, argv)
-int argc;
-char *argv[];
+int main(int argc, char* argv[])
 {
        int i, j, k, errors;
        double od_fline, od_cline;
index 7a71d04d2724c6c8b280363936a4b669b093a914..fc1d59326f8e447cb281e14cb4f89dbc8d95cb1a 100644 (file)
@@ -16,7 +16,7 @@
 
 #include "coregrind/m_debuglog.c"
 
-void run(const char *format, ...)
+int run(const char *format, ...)
 {
   int n, num_stars;
   const char *p;
@@ -44,6 +44,8 @@ void run(const char *format, ...)
 
   emit(buf.buf, strlen(buf.buf));
   fprintf(stderr, "\twrote %3d chars\n", n);
+
+  return num_stars;
 }
 
 int main(int argc, char *argv[])
index 79bbb3ec5e19aada4fb6511116115e8284442cbe..4a6090ee5fdae85003478af3f3e61f21fe1e55ae 100644 (file)
@@ -376,8 +376,7 @@ static double atanc[] = {
 
 /*  aint(x)      Return integer part of number.  Truncates towards 0    */
 
-double aint(x)
-double x;
+double aint(double x)
 {
        long l;
 
@@ -394,8 +393,7 @@ double x;
 
 /*  sin(x)       Return sine, x in radians  */
 
-static double sin(x)
-double x;
+static double sin(double x)
 {
        int sign;
        double y, r, z;
@@ -433,8 +431,7 @@ double x;
 
 /*  cos(x)       Return cosine, x in radians, by identity  */
 
-static double cos(x)
-double x;
+static double cos(double x)
 {
        x = (x < 0.0) ? -x : x;
        if (x > twopi)                /* Do range reduction here to limit */
@@ -444,8 +441,7 @@ double x;
 
 /*  tan(x)       Return tangent, x in radians, by identity  */
 
-static double tan(x)
-double x;
+static double tan(double x)
 {
        return sin(x) / cos(x);
 }
@@ -453,8 +449,7 @@ double x;
 /*  sqrt(x)      Return square root.  Initial guess, then Newton-
                  Raphson refinement  */
 
-double sqrt(x)
-double x;
+double sqrt(double x)
 {
        double c, cl, y;
        int n;
@@ -486,8 +481,7 @@ double x;
 /*  atan(x)      Return arctangent in radians,
                  range -pi/2 to pi/2  */
 
-static double atan(x)
-double x;
+static double atan(double x)
 {
        int sign, l, y;
        double a, b, z;
@@ -526,8 +520,7 @@ atl:
 /*  atan2(y,x)   Return arctangent in radians of y/x,
                  range -pi to pi  */
 
-static double atan2(y, x)
-double y, x;
+static double atan2(double y, double x)
 {
        double temp;
 
@@ -551,8 +544,7 @@ double y, x;
 
 /*  asin(x)      Return arcsine in radians of x  */
 
-static double asin(x)
-double x;
+static double asin(double x)
 {
        if (fabs(x)>1.0) {
           fprintf(stderr,
@@ -670,9 +662,7 @@ static void transit_surface() {
 
 /*  Perform ray trace in specific spectral line  */
 
-static void trace_line(line, ray_h)
-int line;
-double ray_h;
+static void trace_line(int line, double ray_h)
 {
        int i;
 
@@ -697,9 +687,7 @@ double ray_h;
 
 /*  Initialise when called the first time  */
 
-int main(argc, argv)
-int argc;
-char *argv[];
+int main(int argc, char* argv[])
 {
        int i, j, k, errors;
        double od_fline, od_cline;
index 7a02ce43acd4e9f1a47ba1e71754732424ffabf5..1fb21914bbf77a10728cdfffc8d93591e9bfe2ed 100644 (file)
 
 #define SWAP(a,b) tempr=(a); (a)=(b); (b)=tempr
 
-static void fourn(data, nn, ndim, isign)
-  Float data[];
-  int nn[], ndim, isign;
+static void fourn(Float data[], int nn[], int ndim, int isign)
 {
        register int i1, i2, i3;
        int i2rev, i3rev, ip1, ip2, ip3, ifp1, ifp2;