Ticket #21 (closed defect: fixed)

Opened 2 months ago

Last modified 2 months ago

seemingly legal typedef not accepted by the analyser

Reported by: bkomuves(at)gmail(dot)com Assigned to: benedikt
Priority: minor Milestone:
Component: analysis Version:
Keywords: typedef Cc: bkomuves@gmail.com

Description

The code snippet below is happily accepted by gcc (though not with -ansi), however, analyseAST says that

[ERROR]  >>> bad typdef declaration: declarator missing or bitfieldsize/initializer present

As far as I understand, the C99 standard explicitely allows this.

#include <stdio.h>

typedef int Alma,*AlmaPtr;  // this causes the problem

Alma x = 5;

int main()
{ AlmaPtr p = &x;
  printf("%d\n",x);
  (*p) = 10;
  printf("%d\n",x);
  return 0;
} 

Attachments

Change History

11/20/08 13:06:10 changed by benedikt

  • status changed from new to closed.
  • resolution set to fixed.

Thanks for the report, fixed in darcs

  * Fix bug #21: typedef can have more than one declarator

Add/Change #21 (seemingly legal typedef not accepted by the analyser)




Change Properties
Action