view gcc/testsuite/gcc.dg/analyzer/data-model-10.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents
children
line wrap: on
line source

#include <stdlib.h>

struct foo
{
  char **m_f;
};

struct foo *
test (void)
{
  struct foo *new_table = (struct foo *) malloc(sizeof(struct foo));
  if (!new_table)
    return NULL;
  new_table->m_f = (char **)malloc(sizeof(char **));
  *new_table->m_f = NULL; /* { dg-warning "dereference of possibly-NULL '<unknown>'" } */ // FIXME: something better than "unknown" here
  return new_table;
}