Skip to content

Commit

Permalink
Remove flexible array member autoconf check
Browse files Browse the repository at this point in the history
This is configure macro that tries out how to declare a variable array
at the end of struct. This has been standardised in C99, so there is
no more need for non C99 magic. See also this stackoverflow discussion:

https://stackoverflow.com/questions/14643406/whats-the-need-of-array-with-z
ero-elements

Patch V2: Also remove AX_EMPTY_ARRAY from configure.ac

Signed-off-by: Arne Schwabe <[email protected]>
Acked-by: Steffan Karger <[email protected]>
Acked-by: Gert Doering <[email protected]>
Message-Id: <[email protected]>
URL: https://www.mail-archive.com/[email protected]/msg21882.html
Signed-off-by: Gert Doering <[email protected]>
  • Loading branch information
schwabe authored and cron2 committed Mar 28, 2021
1 parent ca57070 commit 7975e33
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 45 deletions.
1 change: 0 additions & 1 deletion config-msvc.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@
#define inline __inline
#endif

#define EMPTY_ARRAY_SIZE 0
#define TARGET_WIN32 1
#define TARGET_ALIAS "Windows-MSVC"

Expand Down
1 change: 0 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,6 @@ AC_TYPE_SIGNAL
AX_CPP_VARARG_MACRO_ISO
AX_CPP_VARARG_MACRO_GCC
AX_TYPE_SOCKLEN_T
AX_EMPTY_ARRAY
AC_CHECK_SIZEOF([unsigned int])
AC_CHECK_SIZEOF([unsigned long])
AC_CHECK_HEADERS([ \
Expand Down
40 changes: 0 additions & 40 deletions m4/ax_emptyarray.m4

This file was deleted.

2 changes: 1 addition & 1 deletion src/openvpn/circ_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
int x_size; \
int x_cap; \
int x_sizeof; \
type x_list[EMPTY_ARRAY_SIZE]; \
type x_list[]; \
}

#define CIRC_LIST_PUSH(obj, item) \
Expand Down
2 changes: 0 additions & 2 deletions src/openvpn/syshead.h
Original file line number Diff line number Diff line change
Expand Up @@ -392,8 +392,6 @@ typedef int MIB_TCP_STATE;
#ifdef PEDANTIC
#undef HAVE_CPP_VARARG_MACRO_GCC
#undef HAVE_CPP_VARARG_MACRO_ISO
#undef EMPTY_ARRAY_SIZE
#define EMPTY_ARRAY_SIZE 1
#undef inline
#define inline
#endif
Expand Down

0 comments on commit 7975e33

Please sign in to comment.