Skip to content

c99 compound literals causing assert #45

Description

@damorinCan

This code is causing splint to assert.


typedef struct
{
  int A;
  int B;
  int C;
} Identifier;

extern void CallThisFunction(Identifier id);

void f(int a, int b, int c)
{
   CallThisFunction((Identifier){a,b,c});
}


The assert:


Splint 3.1.2 --- 07 Mar 2026

constraintGeneration.c:2153: at source point
todel.c:13:2: *** Internal Bug at constraintGeneration.c:2153: llassert failed:
               exprNode_isDefined(el) [errno: 0]
     *** Please report bug to splint-bug@splint.org ***
       (attempting to continue, results may be incorrect)
*** Segmentation Violation
*** Location (not trusted): todel.c:13:2
*** Last code point: exprNode.c:10352
*** Previous code point: exprNode.c:4034
*** Please report bug to splint-bug@splint.org
*** A useful bug report should include everything we need to reproduce the bug.

The problem seems related to this line in cgrammar.y:

| TLPAREN typeExpression TRPAREN TLBRACE typeInitializerList optComma TRBRACE
{ /* added for C99 / $$ = exprNode_undefined; /@i87 no checking */ }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions