Skip to content

Include stdlib.h in ioapi/sortic.c for exit#14

Open
giordano wants to merge 1 commit intocjcoats:masterfrom
giordano:patch-1
Open

Include stdlib.h in ioapi/sortic.c for exit#14
giordano wants to merge 1 commit intocjcoats:masterfrom
giordano:patch-1

Conversation

@giordano
Copy link

The exit function requires the stdlib.h header file. This PR fixes the compilation failure

[16:00:35] /workspace/srcdir/ioapi-3.2/ioapi/sortic.c:322:30: error: call to undeclared library function 'exit' with type 'void (int) __attribute__((noreturn))'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
[16:00:35]         if ( ind[ i ] > n )  exit( 2 ) ;
[16:00:35]                              ^
[16:00:35] /workspace/srcdir/ioapi-3.2/ioapi/sortic.c:322:30: note: include the header <stdlib.h> or explicitly provide a declaration for 'exit'

when using Clang

This fixes the issue
```
[16:00:35] /workspace/srcdir/ioapi-3.2/ioapi/sortic.c:322:30: error: call to undeclared library function 'exit' with type 'void (int) __attribute__((noreturn))'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
[16:00:35]         if ( ind[ i ] > n )  exit( 2 ) ;
[16:00:35]                              ^
[16:00:35] /workspace/srcdir/ioapi-3.2/ioapi/sortic.c:322:30: note: include the header <stdlib.h> or explicitly provide a declaration for 'exit'
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant