On 30.09.19 20:37, Kamil Rytarowski wrote:
On 30.09.2019 19:47, Jakub Jelinek wrote:
On Mon, Sep 30, 2019 at 07:41:00PM +0200, Andreas Tobler wrote:
--- fprintf-2.c (revision 276292)
+++ fprintf-2.c (working copy)
@@ -1,7 +1,8 @@
/* Verify that calls to fprintf don't get eliminated even if their
result on success can be computed at compile time (they can fail).
The calls can still be transformed into those of other functions.
- { dg-skip-if "requires io" { freestanding } } */
+ { dg-skip-if "requires io" { freestanding } }
+ { dg-prune-output "(^|\n)(\[^\n\])*warning: warning: \[^\n\]* possibly used
unsafely; consider using \[^\n\]*\n" } */
I'm worried about that (^|\n) at the start + \n at the end, doesn't it prune
too much then?
Looking at other tests, they dg-prune-output just a few words from a
message, or .*few words.*
So, can you try just
{ dg-prune-output "warning: warning: \[^\n\r\]* possibly used unsafely; consider
using" } */
or if that doesn't work, with .* at start end end?
Jakub
Please handle the NetBSD specific string too: "warning: tmpnam()
possibly used unsafely, use mkstemp() or mkdtemp()".
https://nxr.netbsd.org/xref/src/lib/libc/stdio/tmpnam.c#52
Ok, I think the attached version should also match these cases. Although
untested on NetBSD.
Kamil, if you have cycles, would you mind giving it a run? Thanks!
Andreas
Index: fprintf-2.c
===================================================================
--- fprintf-2.c (revision 276292)
+++ fprintf-2.c (working copy)
@@ -1,7 +1,8 @@
/* Verify that calls to fprintf don't get eliminated even if their
result on success can be computed at compile time (they can fail).
The calls can still be transformed into those of other functions.
- { dg-skip-if "requires io" { freestanding } } */
+ { dg-skip-if "requires io" { freestanding } }
+ { dg-prune-output "warning: warning: \[^\n\r\]* possibly used unsafely" } */
#include <stdio.h>
#include <stdlib.h>
Index: printf-2.c
===================================================================
--- printf-2.c (revision 276292)
+++ printf-2.c (working copy)
@@ -2,7 +2,8 @@
result on success can be computed at compile time (they can fail).
The calls can still be transformed into those of other functions.
{ dg-require-effective-target unwrapped }
- { dg-skip-if "requires io" { freestanding } } */
+ { dg-skip-if "requires io" { freestanding } }
+ { dg-prune-output "warning: warning: \[^\n\r\]* possibly used unsafely" } */
#include <stdio.h>
#include <stdlib.h>
Index: user-printf.c
===================================================================
--- user-printf.c (revision 276292)
+++ user-printf.c (working copy)
@@ -2,7 +2,8 @@
don't get eliminated even if their result on success can be computed at
compile time (they can fail).
{ dg-require-effective-target unwrapped }
- { dg-skip-if "requires io" { freestanding } } */
+ { dg-skip-if "requires io" { freestanding } }
+ { dg-prune-output "warning: warning: \[^\n\r\]* possibly used unsafely" } */
#include <stdarg.h>
#include <stdio.h>