Skip to content

Commit 8399f73

Browse files
authored
Merge pull request neovim#12142 from jamessan/gcc-10-fixes
2 parents 5e47cf2 + faaf83a commit 8399f73

File tree

8 files changed

+14
-9
lines changed

8 files changed

+14
-9
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,11 @@ if(UNIX)
314314
endif()
315315
endif()
316316

317+
check_c_compiler_flag(-fno-common HAVE_FNO_COMMON)
318+
if (HAVE_FNO_COMMON)
319+
add_compile_options(-fno-common)
320+
endif()
321+
317322
check_c_compiler_flag(-fdiagnostics-color=auto HAS_DIAG_COLOR_FLAG)
318323
if(HAS_DIAG_COLOR_FLAG)
319324
if(CMAKE_GENERATOR MATCHES "Ninja")

src/nvim/channel.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include "nvim/ascii.h"
1616

1717
static bool did_stdio = false;
18-
PMap(uint64_t) *channels = NULL;
1918

2019
/// next free id for a job or rpc channel
2120
/// 1 is reserved for stdio channel

src/nvim/channel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ struct Channel {
8585
bool callback_scheduled;
8686
};
8787

88-
EXTERN PMap(uint64_t) *channels;
88+
EXTERN PMap(uint64_t) *channels INIT(= NULL);
8989

9090
#ifdef INCLUDE_GENERATED_DECLARATIONS
9191
# include "channel.h.generated.h"

src/nvim/eval/typval.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ typedef double float_T;
3333
enum { DO_NOT_FREE_CNT = (INT_MAX / 2) };
3434

3535
/// Additional values for tv_list_alloc() len argument
36-
enum {
36+
enum ListLenSpecials {
3737
/// List length is not known in advance
3838
///
3939
/// To be used when there is neither a way to know how many elements will be
@@ -49,7 +49,7 @@ enum {
4949
///
5050
/// To be used when it looks impractical to determine list length.
5151
kListLenMayKnow = -3,
52-
} ListLenSpecials;
52+
};
5353

5454
/// Maximal possible value of varnumber_T variable
5555
#define VARNUMBER_MAX INT64_MAX

src/nvim/getchar.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
/// Values for "noremap" argument of ins_typebuf()
1111
///
1212
/// Also used for map->m_noremap and menu->noremap[].
13-
enum {
13+
enum RemapValues {
1414
REMAP_YES = 0, ///< Allow remapping.
1515
REMAP_NONE = -1, ///< No remapping.
1616
REMAP_SCRIPT = -2, ///< Remap script-local mappings only.
1717
REMAP_SKIP = -3, ///< No remapping for first char.
18-
} RemapValues;
18+
};
1919

2020
// Argument for flush_buffers().
2121
typedef enum {

src/nvim/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <msgpack.h>
1111

1212
#include "nvim/ascii.h"
13+
#include "nvim/channel.h"
1314
#include "nvim/vim.h"
1415
#include "nvim/main.h"
1516
#include "nvim/aucmd.h"

src/nvim/msgpack_rpc/channel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
/// HACK: os/input.c drains this queue immediately before blocking for input.
1616
/// Events on this queue are async-safe, but they need the resolved state
1717
/// of os_inchar(), so they are processed "just-in-time".
18-
MultiQueue *ch_before_blocking_events;
18+
EXTERN MultiQueue *ch_before_blocking_events INIT(= NULL);
1919

2020

2121
#ifdef INCLUDE_GENERATED_DECLARATIONS

src/nvim/viml/parser/expressions.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ struct expr_ast_node {
326326
} data;
327327
};
328328

329-
enum {
329+
enum ExprParserFlags {
330330
/// Allow multiple expressions in a row: e.g. for :echo
331331
///
332332
/// Parser will still parse only one of them though.
@@ -345,7 +345,7 @@ enum {
345345
// viml_expressions_parser.c, nvim_parse_expression() flags parsing
346346
// alongside with its documentation and flag sets in check_parsing()
347347
// function in expressions parser functional and unit tests.
348-
} ExprParserFlags;
348+
};
349349

350350
/// AST error definition
351351
typedef struct {

0 commit comments

Comments
 (0)