@gccoptlist{-fno-diagnostics-show-caret @gol
-fno-diagnostics-show-line-numbers @gol
-fdiagnostics-color=never @gol
--fdiagnostics-urls=never}
+-fdiagnostics-urls=never @gol
+-fdiagnostics-path-format=separate-events}
In the future, if GCC changes the default appearance of its diagnostics, the
corresponding option to disable the new behavior will be added to this list.
"-fno-diagnostics-show-line-numbers",
"-fdiagnostics-color=never",
"-fdiagnostics-urls=never",
+ "-fdiagnostics-path-format=separate-events",
};
const int num_expanded = ARRAY_SIZE (expanded_args);
opt_array_len += num_expanded - 1;
}
# If a testcase doesn't have special options, use these.
-set DEFAULT_CXXFLAGS " -fanalyzer -fdiagnostics-path-format=separate-events -Wanalyzer-too-complex -fanalyzer-call-summaries"
+set DEFAULT_CXXFLAGS " -fanalyzer -Wanalyzer-too-complex -fanalyzer-call-summaries"
# Initialize `dg'.
dg-init
}
# If a testcase doesn't have special options, use these.
-set DEFAULT_CFLAGS "-fanalyzer -fdiagnostics-path-format=separate-events -Wanalyzer-too-complex -fanalyzer-call-summaries"
+set DEFAULT_CFLAGS "-fanalyzer -Wanalyzer-too-complex -fanalyzer-call-summaries"
# Initialize `dg'.
dg-init
+++ /dev/null
-/* { dg-do compile } */
-/* { dg-options "-fdiagnostics-show-caret" } */
-
-#include <stdlib.h>
-
-void *wrapped_malloc (size_t size)
-{
- return malloc (size);
-}
-
-void wrapped_free (void *ptr)
-{
- free (ptr); /* { dg-warning "double-free of 'ptr' \\\[CWE-415\\]" } */
- /* { dg-begin-multiline-output "" }
- free (ptr);
- ^~~~~~~~~~
- 'test': events 1-2
- |
- | {
- | ^
- | |
- | (1) entering 'test'
- | boxed_int *obj = make_boxed_int (i);
- | ~~~~~~~~~~~~~~~~~~
- | |
- | (2) calling 'make_boxed_int'
- |
- +--> 'make_boxed_int': events 3-4
- |
- | {
- | ^
- | |
- | (3) entering 'make_boxed_int'
- | boxed_int *result = (boxed_int *)wrapped_malloc (sizeof (boxed_int));
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- | |
- | (4) calling 'wrapped_malloc'
- |
- +--> 'wrapped_malloc': events 5-6
- |
- | {
- | ^
- | |
- | (5) entering 'wrapped_malloc'
- | return malloc (size);
- | ~~~~~~~~~~~~~
- | |
- | (6) calling 'malloc'
- |
- <-------------+
- |
- 'test': event 7
- |
- | free_boxed_int (obj);
- | ^~~~~~~~~~~~~~~~~~~~
- | |
- | (7) calling 'free_boxed_int'
- |
- +--> 'free_boxed_int': events 8-9
- |
- | {
- | ^
- | |
- | (8) entering 'free_boxed_int'
- | wrapped_free (bi);
- | ~~~~~~~~~~~~~~~~~
- | |
- | (9) calling 'wrapped_free'
- |
- +--> 'wrapped_free': events 10-11
- |
- | {
- | ^
- | |
- | (10) entering 'wrapped_free'
- | free (ptr);
- | ~~~~~~~~~~
- | |
- | (11) calling 'free'
- |
- <-------------+
- |
- 'test': event 12
- |
- | free_boxed_int (obj);
- | ^~~~~~~~~~~~~~~~~~~~
- | |
- | (12) calling 'free_boxed_int'
- |
- +--> 'free_boxed_int': events 13-14
- |
- | {
- | ^
- | |
- | (13) entering 'free_boxed_int'
- | wrapped_free (bi);
- | ~~~~~~~~~~~~~~~~~
- | |
- | (14) calling 'wrapped_free'
- |
- +--> 'wrapped_free': events 15-16
- |
- | {
- | ^
- | |
- | (15) entering 'wrapped_free'
- | free (ptr);
- | ~~~~~~~~~~
- | |
- | (16) calling 'free'
- |
- { dg-end-multiline-output "" } */
-}
-
-typedef struct boxed_int
-{
- int i;
-} boxed_int;
-
-boxed_int *
-make_boxed_int (int i)
-{
- boxed_int *result = (boxed_int *)wrapped_malloc (sizeof (boxed_int));
- result->i = i;
- return result;
-}
-
-void
-free_boxed_int (boxed_int *bi)
-{
- wrapped_free (bi);
-}
-
-void test (int i)
-{
- boxed_int *obj = make_boxed_int (i);
-
- free_boxed_int (obj);
-
- free_boxed_int (obj);
-}
-
--- /dev/null
+/* { dg-do compile } */
+
+#include <stdlib.h>
+
+void *wrapped_malloc (size_t size)
+{
+ return malloc (size);
+}
+
+void wrapped_free (void *ptr)
+{
+ free (ptr); /* { dg-warning "double-free of 'ptr' \\\[CWE-415\\]" } */
+}
+
+typedef struct boxed_int
+{
+ int i;
+} boxed_int;
+
+boxed_int *
+make_boxed_int (int i)
+{
+ boxed_int *result = (boxed_int *)wrapped_malloc (sizeof (boxed_int));
+ result->i = i;
+ return result;
+}
+
+void
+free_boxed_int (boxed_int *bi)
+{
+ wrapped_free (bi);
+}
+
+void test (int i)
+{ /* { dg-message "\\(1\\) entering 'test'" } */
+ boxed_int *obj = make_boxed_int (i); /* { dg-message "\\(2\\) calling 'make_boxed_int'" } */
+ /* etc */
+
+ free_boxed_int (obj);
+
+ free_boxed_int (obj);
+}
/* { dg-do compile } */
-/* { dg-options "-fdiagnostics-show-caret -fdiagnostics-show-line-numbers" } */
+/* { dg-options "-fdiagnostics-show-caret -fdiagnostics-show-line-numbers -fdiagnostics-path-format=inline-events" } */
#include <stddef.h>
#include <stdlib.h>
| | (1) when 'PyList_New' fails, returning NULL
| 26 |
| 27 | for (i = 0; i < count; i++) {
- | | ~~~
- | | |
- | | (2) when 'i < count'
+ | | ~~~~~~~~~
+ | | |
+ | | (2) when 'i < count'
| 28 | item = PyLong_FromLong(random());
| 29 | PyList_Append(list, item);
| | ~~~~~~~~~~~~~~~~~~~~~~~~~
diagnostic-test-paths-2.c \
diagnostic-test-paths-3.c \
diagnostic-test-paths-4.c \
- diagnostic-path-format-default.c \
+ diagnostic-path-format-plain.c \
diagnostic-path-format-none.c \
diagnostic-path-format-separate-events.c \
diagnostic-path-format-inline-events-1.c \
}
# If a testcase doesn't have special options, use these.
-set DEFAULT_FFLAGS "-fanalyzer -fdiagnostics-path-format=separate-events -Wanalyzer-too-complex -fanalyzer-call-summaries"
+set DEFAULT_FFLAGS "-fanalyzer -Wanalyzer-too-complex -fanalyzer-call-summaries"
# Initialize `dg'.
dg-init