mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 21:21:48 +03:00
ImportC: improve error message for size_t (#21187)
Resolves: https://github.com/dlang/dmd/issues/20414 Add some hints for common missing includes.
This commit is contained in:
parent
ca2f90d1fc
commit
74cdfed9d6
5 changed files with 83 additions and 21 deletions
15
compiler/test/fail_compilation/test20414.c
Normal file
15
compiler/test/fail_compilation/test20414.c
Normal file
|
@ -0,0 +1,15 @@
|
|||
/* TEST_OUTPUT:
|
||||
---
|
||||
fail_compilation/test20414.c(1): Error: `size_t` is not defined, perhaps `#include <stddef.h>` ?
|
||||
fail_compilation/test20414.c(2): Error: `ptrdiff_t` is not defined, perhaps `#include <stddef.h>` ?
|
||||
fail_compilation/test20414.c(3): Error: `NULL` is not defined, perhaps `#include <stddef.h>` is needed?
|
||||
fail_compilation/test20414.c(5): Error: undefined identifier `fooo`, did you mean function `foo`?
|
||||
---
|
||||
*/
|
||||
|
||||
#line 1
|
||||
size_t x;
|
||||
ptrdiff_t pd;
|
||||
void *p = NULL;
|
||||
void foo(void);
|
||||
void (*fp)(void) = &fooo;
|
Loading…
Add table
Add a link
Reference in a new issue