Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Incomplete type analysis? #6

Copy link
Copy link
@P-p-H-d

Description

@P-p-H-d
Issue body actions

For the following program which is faulty (it gives an integer instead of a structure as argument of the map for the insert call),

#include <stdio.h>
#include <string.h>
#include "cc.h"

typedef struct { int x, y, z; } mp;
#define CC_CMPR mp, { return memcmp( &val_1, &val_2, sizeof (mp)); }
#define CC_HASH mp, { return val.x ^ val.y ^ val.z; }
#include "cc.h"

int main( void )
{
  map(mp, mp) map;
  init(&map);
  if (!insert(&map, 12, 12)) {
    abort();
  }
  cleanup(&map);
  return 0;
}

the compilation succeeds with some "missing braces around initializer [-Wmissing-braces]" warnings
whereas I was expecting a compilation failure or at least a warning about incompatible pointer.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.