@@ -56,6 +56,15 @@ struct aws_future_impl {
56
56
};
57
57
58
58
static void s_future_impl_result_dtor (struct aws_future_impl * future , void * result_addr ) {
59
+
60
+ /*
61
+ * On ARM machines, the compiler complains about the array bounds warning for aws_future_bool, even though
62
+ * aws_future_bool will never go into any destroy or release branch. Disable the warning since it's a false positive.
63
+ */
64
+ #ifndef _MSC_VER
65
+ # pragma GCC diagnostic push
66
+ # pragma GCC diagnostic ignored "-Warray-bounds"
67
+ #endif
59
68
switch (future -> type ) {
60
69
case AWS_FUTURE_T_BY_VALUE_WITH_CLEAN_UP : {
61
70
future -> result_dtor .clean_up (result_addr );
@@ -79,6 +88,9 @@ static void s_future_impl_result_dtor(struct aws_future_impl *future, void *resu
79
88
default :
80
89
break ;
81
90
}
91
+ #ifndef _MSC_VER
92
+ # pragma GCC diagnostic pop
93
+ #endif
82
94
}
83
95
84
96
static void s_future_impl_destroy (void * user_data ) {
@@ -472,60 +484,7 @@ bool aws_future_impl_wait(const struct aws_future_impl *future, uint64_t timeout
472
484
return is_done ;
473
485
}
474
486
475
- // AWS_FUTURE_T_BY_VALUE_IMPLEMENTATION(aws_future_bool, bool)
476
- struct aws_future_bool * aws_future_bool_new (struct aws_allocator * alloc ) {
477
- return (struct aws_future_bool * )aws_future_impl_new_by_value (alloc , sizeof (_Bool ));
478
- }
479
- void aws_future_bool_set_result (struct aws_future_bool * future , _Bool result ) {
480
- aws_future_impl_set_result_by_move ((struct aws_future_impl * )future , & result );
481
- }
482
- _Bool aws_future_bool_get_result (const struct aws_future_bool * future ) {
483
- return * (_Bool * )aws_future_impl_get_result_address ((const struct aws_future_impl * )future );
484
- }
485
- struct aws_future_bool * aws_future_bool_acquire (struct aws_future_bool * future ) {
486
- return (struct aws_future_bool * )aws_future_impl_acquire ((struct aws_future_impl * )future );
487
- }
488
- struct aws_future_bool * aws_future_bool_release (struct aws_future_bool * future ) {
489
- return (struct aws_future_bool * )aws_future_impl_release ((struct aws_future_impl * )future );
490
- }
491
- void aws_future_bool_set_error (struct aws_future_bool * future , int error_code ) {
492
- aws_future_impl_set_error ((struct aws_future_impl * )future , error_code );
493
- }
494
- _Bool aws_future_bool_is_done (const struct aws_future_bool * future ) {
495
- return aws_future_impl_is_done ((const struct aws_future_impl * )future );
496
- }
497
- int aws_future_bool_get_error (const struct aws_future_bool * future ) {
498
- return aws_future_impl_get_error ((const struct aws_future_impl * )future );
499
- }
500
- void aws_future_bool_register_callback (
501
- struct aws_future_bool * future ,
502
- aws_future_callback_fn * on_done ,
503
- void * user_data ) {
504
- aws_future_impl_register_callback ((struct aws_future_impl * )future , on_done , user_data );
505
- }
506
- _Bool aws_future_bool_register_callback_if_not_done (
507
- struct aws_future_bool * future ,
508
- aws_future_callback_fn * on_done ,
509
- void * user_data ) {
510
- return aws_future_impl_register_callback_if_not_done ((struct aws_future_impl * )future , on_done , user_data );
511
- }
512
- void aws_future_bool_register_event_loop_callback (
513
- struct aws_future_bool * future ,
514
- struct aws_event_loop * event_loop ,
515
- aws_future_callback_fn * on_done ,
516
- void * user_data ) {
517
- aws_future_impl_register_event_loop_callback ((struct aws_future_impl * )future , event_loop , on_done , user_data );
518
- }
519
- void aws_future_bool_register_channel_callback (
520
- struct aws_future_bool * future ,
521
- struct aws_channel * channel ,
522
- aws_future_callback_fn * on_done ,
523
- void * user_data ) {
524
- aws_future_impl_register_channel_callback ((struct aws_future_impl * )future , channel , on_done , user_data );
525
- }
526
- _Bool aws_future_bool_wait (struct aws_future_bool * future , uint64_t timeout_ns ) {
527
- return aws_future_impl_wait ((struct aws_future_impl * )future , timeout_ns );
528
- }
487
+ AWS_FUTURE_T_BY_VALUE_IMPLEMENTATION (aws_future_bool , bool )
529
488
530
489
AWS_FUTURE_T_BY_VALUE_IMPLEMENTATION (aws_future_size , size_t )
531
490
0 commit comments