Project

General

Profile

Actions

Bug #1333

open

CIL misses fields in unions

Added by Vadim Mutilin over 13 years ago. Updated about 10 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
CIL
Start date:
06/08/2011
Due date:
% Done:

0%

Estimated time:
Detected in build:
657406aad
Platform:
Published in build:

Description

From the structure

struct kernel_param {
 const char *name;
 const struct kernel_param_ops *ops;
 u16 perm;
 u16 flags;
 union {
  void *arg;
  const struct kparam_string *str;
  const struct kparam_array *arr;
 };
};

it generates

struct kernel_param {
   char const   *name ;
   struct kernel_param_ops  const  *ops ;
   u16 perm ;
   u16 flags ;
   union __anonunion____missing_field_name_120 __annonCompField19 ;
};

where fields in union are missed.

After that CPAcheker fails with exception

unknown initializer: CASTDesignatedInitializer in line 8550: .arr = & __param_arr_eisa (CPAchecker.run, SEVERE)

for the code

static struct kernel_param  const  __param_eisa  __attribute__((__used__, __unused__,
__section__("__param"), __aligned__(sizeof(void *))))  =    {__param_str_eisa, (struct kernel_param_ops  const  *)(& param_array_ops), (u16 )0,
    (u16 )0, {.arr = & __param_arr_eisa}};

Actions

Also available in: Atom PDF