Skip to content

Commit 1e9a251

Browse files
sam-githubMylesBorins
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 7de4dfb commit 1e9a251

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
@@ -505,13 +505,13 @@ class Http2Stream::Provider::Stream : public Http2Stream::Provider {
505505
void* user_data);
506506
};
507507

508-
typedef struct {
508+
struct SessionJSFields {
509509
uint8_t bitfield;
510510
uint8_t priority_listener_count;
511511
uint8_t frame_error_listener_count;
512512
uint32_t max_invalid_frames = 1000;
513513
uint32_t max_rejected_streams = 100;
514-
} SessionJSFields;
514+
};
515515

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

0 commit comments

Comments
 (0)