diff --git a/binutils/strings.c b/binutils/strings.c
index 44a8e1da644..4010829dc49 100644
--- a/binutils/strings.c
+++ b/binutils/strings.c
@@ -617,7 +617,7 @@ print_filename_and_address (const char * filename, file_ptr address)
     case 8:
       if (sizeof (address) > sizeof (long))
 	{
-#ifndef __MSVCRT__
+#if !defined(__MSVCRT__) || defined(__USE_MINGW_ANSI_STDIO)
 	  printf ("%7llo ", (unsigned long long) address);
 #else
 	  printf ("%7I64o ", (unsigned long long) address);
@@ -630,7 +630,7 @@ print_filename_and_address (const char * filename, file_ptr address)
     case 10:
       if (sizeof (address) > sizeof (long))
 	{
-#ifndef __MSVCRT__
+#if !defined(__MSVCRT__) || defined(__USE_MINGW_ANSI_STDIO)
 	  printf ("%7llu ", (unsigned long long) address);
 #else
 	  printf ("%7I64d ", (unsigned long long) address);
@@ -643,7 +643,7 @@ print_filename_and_address (const char * filename, file_ptr address)
     case 16:
       if (sizeof (address) > sizeof (long))
 	{
-#ifndef __MSVCRT__
+#if !defined(__MSVCRT__) || defined(__USE_MINGW_ANSI_STDIO)
 	  printf ("%7llx ", (unsigned long long) address);
 #else
 	  printf ("%7I64x ", (unsigned long long) address);
diff --git a/gas/as.h b/gas/as.h
index 14a768f8889..b1f056f115a 100644
--- a/gas/as.h
+++ b/gas/as.h
@@ -433,14 +433,14 @@ typedef struct _pseudo_type pseudo_typeS;
 
 #define PRINTF_LIKE(FCN) \
   void FCN (const char *format, ...) \
-    __attribute__ ((__format__ (__printf__, 1, 2)))
+    __attribute__ ((__format__ (gnu_printf, 1, 2)))
 #define PRINTF_WHERE_LIKE(FCN) \
   void FCN (const char *file, unsigned int line, const char *format, ...) \
-    __attribute__ ((__format__ (__printf__, 3, 4)))
+    __attribute__ ((__format__ (gnu_printf, 3, 4)))
 #define PRINTF_INDENT_LIKE(FCN) \
   void FCN (const char *file, unsigned int line, unsigned int indent, \
 	    const char *format, ...) \
-    __attribute__ ((__format__ (__printf__, 4, 5)))
+    __attribute__ ((__format__ (gnu_printf, 4, 5)))
 
 #else /* __GNUC__ < 2 || defined(VMS) */
 
diff --git a/include/ansidecl.h b/include/ansidecl.h
index 0515228f325..7c2b9f18306 100644
--- a/include/ansidecl.h
+++ b/include/ansidecl.h
@@ -195,7 +195,7 @@ So instead we use the macro below and test it against specific values.  */
    before GCC 3.3, but as of 3.3 we need to add the `nonnull'
    attribute to retain this behavior.  */
 #ifndef ATTRIBUTE_PRINTF
-#define ATTRIBUTE_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n))) ATTRIBUTE_NONNULL(m)
+#define ATTRIBUTE_PRINTF(m, n) __attribute__ ((__format__ (gnu_printf, m, n))) ATTRIBUTE_NONNULL(m)
 #define ATTRIBUTE_PRINTF_1 ATTRIBUTE_PRINTF(1, 2)
 #define ATTRIBUTE_PRINTF_2 ATTRIBUTE_PRINTF(2, 3)
 #define ATTRIBUTE_PRINTF_3 ATTRIBUTE_PRINTF(3, 4)
@@ -223,7 +223,7 @@ So instead we use the macro below and test it against specific values.  */
    NULL format specifier was allowed as of gcc 3.3.  */
 #ifndef ATTRIBUTE_NULL_PRINTF
 # if (GCC_VERSION >= 3003)
-#  define ATTRIBUTE_NULL_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n)))
+#  define ATTRIBUTE_NULL_PRINTF(m, n) __attribute__ ((__format__ (gnu_printf, m, n)))
 # else
 #  define ATTRIBUTE_NULL_PRINTF(m, n)
 # endif /* GNUC >= 3.3 */
-- 
2.32.0
