diff --git a/lib/cmock_header_parser.rb b/lib/cmock_header_parser.rb index 24decc6..f0c5907 100644 --- a/lib/cmock_header_parser.rb +++ b/lib/cmock_header_parser.rb @@ -143,7 +143,7 @@ class CMockHeaderParser return 'void' else c=0 - arg_list.gsub!(/(\w+)(?:\s*\[[\s\d]*\])+/,'*\1') # magically turn brackets into asterisks + arg_list.gsub!(/(\w+)(?:\s*\[[\s\d\w]*\])+/,'*\1') # magically turn brackets into asterisks arg_list.gsub!(/\s+\*/,'*') # remove space to place asterisks with type (where they belong) arg_list.gsub!(/\*(\w)/,'* \1') # pull asterisks away from arg to place asterisks with type (where they belong) diff --git a/targets/gcc.yml b/targets/gcc.yml index 4b1c223..92fb398 100644 --- a/targets/gcc.yml +++ b/targets/gcc.yml @@ -8,6 +8,7 @@ compiler: options: - '-c' - '-Wall' + - '-Wno-address' - '-std=c99' - '-pedantic' includes: diff --git a/targets/gcc_64.yml b/targets/gcc_64.yml index 7bbbeff..b4f9508 100644 --- a/targets/gcc_64.yml +++ b/targets/gcc_64.yml @@ -9,6 +9,7 @@ compiler: - '-c' - '-Wall' - '-std=c99' + - '-Wno-address' - '-pedantic-errors' includes: prefix: '-I' diff --git a/test/system/test_interactions/array_and_pointer_handling.yml b/test/system/test_interactions/array_and_pointer_handling.yml index 773b46d..492dc2c 100644 --- a/test/system/test_interactions/array_and_pointer_handling.yml +++ b/test/system/test_interactions/array_and_pointer_handling.yml @@ -10,11 +10,12 @@ int x; int y; } POINT_T; + #define ARRAY_A_SIZE (5) :mockable: | void foo(POINT_T* a); POINT_T* bar(void); - void fooa(POINT_T a[]); + void fooa(POINT_T a[ARRAY_A_SIZE]); void foos(const char * a); const char * bars(void); void no_pointers(int a, char* b);