#include <support/support.h>
#include <support/xdirent.h>
#include <support/readdir.h>
+#include <libc-diag.h>
/* If positive, at this length an EMSGSIZE error is injected. */
static _Atomic int inject_error_at_length;
if (offset <= 1)
{
type = DT_DIR;
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
name = ".." + !offset; /* "." or "..". */
+ DIAG_POP_NEEDS_COMMENT_CLANG;
ino = 1;
}
else if (length == 1000)
#include <support/readdir.h>
#include <support/support.h>
#include <support/xdirent.h>
+#include <libc-diag.h>
/* Return the file name at the indicated directory offset. */
static char *
name_at_offset (unsigned int offset)
{
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
if (offset <= 1)
return xstrdup (".." + !offset); /* "." or "..". */
else
/* Pad the name with a lot of zeros, so that the dirent buffer gets
filled more quickly. */
return xasprintf ("file%0240u", offset);
+ DIAG_POP_NEEDS_COMMENT_CLANG;
}
/* This many directory entries, including "." and "..". */
#include <support/support.h>
#include <support/test-driver.h>
#include <stdio.h>
+#include <libc-diag.h>
/* FROM is the input character set, TO the output character set. If
IGNORE is true, the iconv descriptor is set up in the same way as
for (int skip = 0; skip < 3; ++skip)
{
const char *expected_output;
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
if (do_ignore || strstr (charsets[to_idx], "//IGNORE") != NULL)
expected_output = "ABXY" + skip;
else
expected_output = "AB" + skip;
one_direction (charsets[from_idx], charsets[to_idx], do_ignore,
"AB\xffXY" + skip, expected_output, limit);
+ DIAG_POP_NEEDS_COMMENT_CLANG;
}
return 0;
#include <regex.h>
#include <stdio.h>
#include <string.h>
+#include <libc-diag.h>
#define str "civic"
{
int len = m[i].rm_eo - m[i].rm_so;
+ DIAG_PUSH_NEEDS_COMMENT_CLANG;
+ DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int");
printf ("m[%d] = \"%.*s\"\n", i, len, str + m[i].rm_so);
if (strlen (expected[i]) != len
|| memcmp (expected[i], str + m[i].rm_so, len) != 0)
result = 1;
+ DIAG_POP_NEEDS_COMMENT_CLANG;
}
return result;