Skip to content

Commit 17e10dd

Browse files
sam-githubcodebytere
authored andcommitted
src: use C++ style for struct with initializers
Fixes warning on clang 11: In file included from ../../src/node_http2.cc:6: ../../src/node_http2.h:508:15: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Wnon-c-typedef-for-linkage] typedef struct { ^ SessionJSFields ../../src/node_http2.h:512:33: note: type is not C-compatible due to this default member initializer uint32_t max_invalid_frames = 1000; ^~~~ ../../src/node_http2.h:514:3: note: type is given name 'SessionJSFields' for linkage purposes by this typedef declaration } SessionJSFields; ^ PR-URL: #32134 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: David Carlier <[email protected]>
1 parent bb947ce commit 17e10dd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/node_http2.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -678,13 +678,13 @@ class Http2Stream::Provider::Stream : public Http2Stream::Provider {
678678
void* user_data);
679679
};
680680

681-
typedef struct {
681+
struct SessionJSFields {
682682
uint8_t bitfield;
683683
uint8_t priority_listener_count;
684684
uint8_t frame_error_listener_count;
685685
uint32_t max_invalid_frames = 1000;
686686
uint32_t max_rejected_streams = 100;
687-
} SessionJSFields;
687+
};
688688

689689
// Indices for js_fields_, which serves as a way to communicate data with JS
690690
// land fast. In particular, we store information about the number/presence

0 commit comments

Comments
 (0)