Skip to content

Commit 03bfbb1

Browse files
committed
Fix building YARP
Building fails on CI with the following errors: ``` include/yarp/ast.h:349:50: error: conversion to ‘unsigned int’ from ‘int’ may change the sign of the result [-Werror=sign-conversion] static const unsigned int YP_NODE_FLAG_NEWLINE = 1 << YP_NODE_FLAGS_SHIFT; ^ ``` and ``` include/yarp/ast.h:349:50: error: initializer element is not constant static const unsigned int YP_NODE_FLAG_NEWLINE = 1U << YP_NODE_FLAGS_SHIFT; ^~ ```
1 parent 9effc42 commit 03bfbb1

File tree

1 file changed

+2
-2
lines changed
  • src/main/c/yarp/include/yarp

1 file changed

+2
-2
lines changed

src/main/c/yarp/include/yarp/ast.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,8 @@ typedef enum {
346346
// We store the node type enum in every node in the tree. We don't have nearly
347347
// as many node types as we do bits in an enum, so we're going to use the top
348348
// half of the enum to store flags about the node.
349-
static const unsigned int YP_NODE_FLAGS_SHIFT = sizeof(yp_node_type_t) * 8 / 2;
350-
static const unsigned int YP_NODE_FLAG_NEWLINE = 1 << YP_NODE_FLAGS_SHIFT;
349+
#define YP_NODE_FLAGS_SHIFT (sizeof(yp_node_type_t) * 8 / 2)
350+
#define YP_NODE_FLAG_NEWLINE (1U << YP_NODE_FLAGS_SHIFT)
351351

352352
// For easy access, we define some macros that manipulate only the bottom half
353353
// of the node type enum.

0 commit comments

Comments
 (0)