Description: __FUNCTION__ is deprecated and throw a pedantic warning when built with c11
Author: Mattia Rizzolo <mattia@debian.org>
Forwarded: https://github.com/stewartsmith/libeatmydata/pull/21
Last-Update: 2020-04-28

--- a/libeatmydata/test/tst-cancel4.c
+++ b/libeatmydata/test/tst-cancel4.c
@@ -113,21 +113,21 @@
   tempfd = mkostemp(fname, O_RDONLY);
   if (tempfd == -1)
     {
-      printf ("%s: cannot open %s\n", __FUNCTION__, fname);
+      printf ("%s: cannot open %s\n", __func__, fname);
       exit (1);
     }
 
   int r = pthread_barrier_wait (&b2);
   if (r != 0 && r != PTHREAD_BARRIER_SERIAL_THREAD)
     {
-      printf ("%s: barrier_wait failed\n", __FUNCTION__);
+      printf ("%s: barrier_wait failed\n", __func__);
       exit (1);
     }
 
   r = pthread_barrier_wait (&b2);
   if (r != 0 && r != PTHREAD_BARRIER_SERIAL_THREAD)
     {
-      printf ("%s: 2nd barrier_wait failed\n", __FUNCTION__);
+      printf ("%s: 2nd barrier_wait failed\n", __func__);
       exit (1);
     }
 
@@ -137,7 +137,7 @@
 
   pthread_cleanup_pop (0);
 
-  printf ("%s: fsync returned\n", __FUNCTION__);
+  printf ("%s: fsync returned\n", __func__);
 
   unlink(fname);
   free(fname);
@@ -159,21 +159,21 @@
   tempfd = mkostemp(fname, O_RDONLY);
   if (tempfd == -1)
     {
-      printf ("%s: cannot open %s\n", __FUNCTION__, fname);
+      printf ("%s: cannot open %s\n", __func__, fname);
       exit (1);
     }
 
   int r = pthread_barrier_wait (&b2);
   if (r != 0 && r != PTHREAD_BARRIER_SERIAL_THREAD)
     {
-      printf ("%s: barrier_wait failed\n", __FUNCTION__);
+      printf ("%s: barrier_wait failed\n", __func__);
       exit (1);
     }
 
   r = pthread_barrier_wait (&b2);
   if (r != 0 && r != PTHREAD_BARRIER_SERIAL_THREAD)
     {
-      printf ("%s: 2nd barrier_wait failed\n", __FUNCTION__);
+      printf ("%s: 2nd barrier_wait failed\n", __func__);
       exit (1);
     }
 
@@ -183,7 +183,7 @@
 
   pthread_cleanup_pop (0);
 
-  printf ("%s: fdatasync returned\n", __FUNCTION__);
+  printf ("%s: fdatasync returned\n", __func__);
 
   unlink(fname);
   free(fname);
@@ -205,28 +205,28 @@
   tempfd = mkostemp(fname, O_RDONLY);
   if (tempfd == -1)
     {
-      printf ("%s: cannot open %s\n", __FUNCTION__, fname);
+      printf ("%s: cannot open %s\n", __func__, fname);
       exit (1);
     }
 
   void *p = mmap (NULL, 10, PROT_READ, MAP_SHARED, tempfd, 0);
   if (p == MAP_FAILED)
     {
-      printf ("%s: mmap failed\n", __FUNCTION__);
+      printf ("%s: mmap failed\n", __func__);
       exit (1);
     }
 
   int r = pthread_barrier_wait (&b2);
   if (r != 0 && r != PTHREAD_BARRIER_SERIAL_THREAD)
     {
-      printf ("%s: barrier_wait failed\n", __FUNCTION__);
+      printf ("%s: barrier_wait failed\n", __func__);
       exit (1);
     }
 
   r = pthread_barrier_wait (&b2);
   if (r != 0 && r != PTHREAD_BARRIER_SERIAL_THREAD)
     {
-      printf ("%s: 2nd barrier_wait failed\n", __FUNCTION__);
+      printf ("%s: 2nd barrier_wait failed\n", __func__);
       exit (1);
     }
 
@@ -236,7 +236,7 @@
 
   pthread_cleanup_pop (0);
 
-  printf ("%s: msync returned\n", __FUNCTION__);
+  printf ("%s: msync returned\n", __func__);
 
   unlink(fname);
   free(fname);
@@ -310,7 +310,7 @@
       int r = pthread_barrier_wait (&b2);
       if (r != 0 && r != PTHREAD_BARRIER_SERIAL_THREAD)
 	{
-	  printf ("%s: barrier_wait failed\n", __FUNCTION__);
+	  printf ("%s: barrier_wait failed\n", __func__);
 	  result = 1;
 	  continue;
 	}
@@ -408,7 +408,7 @@
       int r = pthread_barrier_wait (&b2);
       if (r != 0 && r != PTHREAD_BARRIER_SERIAL_THREAD)
 	{
-	  printf ("%s: barrier_wait failed\n", __FUNCTION__);
+	  printf ("%s: barrier_wait failed\n", __func__);
 	  result = 1;
 	  continue;
 	}
@@ -423,7 +423,7 @@
       r = pthread_barrier_wait (&b2);
       if (r != 0 && r != PTHREAD_BARRIER_SERIAL_THREAD)
 	{
-	  printf ("%s: barrier_wait failed\n", __FUNCTION__);
+	  printf ("%s: barrier_wait failed\n", __func__);
 	  result = 1;
 	  continue;
 	}
