Project

General

Profile

Actions

Bug #4789

open

Missing extern declarations for the arrays

Added by Vadim Mutilin over 10 years ago. Updated almost 9 years ago.

Status:
Open
Priority:
High
Category:
C back-end
Start date:
03/25/2014
Due date:
% Done:

0%

Estimated time:
Detected in build:
svn
Platform:
Published in build:

Description

For the driver

linux-3.12-rc1.tar.xz    32_7a    drivers/media/v4l2-core/videodev.ko    ldv_main0_sequence_infinite_withcheck_stateful

CIF produces the code
static inline long unsigned int free_initmem_default(int poison)
{
  char __init_begin[];
# 1350 "include/linux/mm.h" 
  char __init_end[];
# 1352 "include/linux/mm.h" 
  return free_reserved_area ( ( void *) & __init_begin , ( void *) & __init_end , poison ,
# 1353 "include/linux/mm.h" 
  ( char *) "unused kernel" );
}

which leads to the error
include/linux/mm.h:1350:8: error: array size missing in ‘__init_begin’
include/linux/mm.h:1350:8: error: array size missing in ‘__init_end’

original code:
extern char __init_begin[], __init_end[];


Related issues 1 (0 open1 closed)

Has duplicate C Instrumentation Framework - Bug #5278: CIF misses extern for local declarationsRejected09/19/2014

Actions
Actions #1

Updated by Evgeny Novikov over 10 years ago

  • Status changed from New to Open

Turned out to be a compiler warning that is ignored by our main verifiers.

Actions #2

Updated by Vadim Mutilin over 10 years ago

Now this issue occurs in the generated code
extern char __init_begin[];
extern char __init_end[];
static inline long unsigned int free_initmem_default(int poison) {
char __init_begin[];
char __init_end[];
return free_reserved_area ( ( void *) & __init_begin , ( void *) & __init_end , poison ,
( char *) "unused kernel" );
}

The array without size can not be allocated on the stack

Actions #3

Updated by Evgeny Novikov over 10 years ago

I didn't catch, where the issue was before?

Actions #4

Updated by Vadim Mutilin over 10 years ago

As I can see with a fresh look it is the same issue as before.

GCC reports the error, but CIL and CPAchecker frontends skip the issue.

Actions #5

Updated by Evgeny Novikov almost 9 years ago

  • Category set to C back-end
  • Assignee set to Evgeny Novikov
  • Priority changed from Normal to High
Actions

Also available in: Atom PDF