-
Notifications
You must be signed in to change notification settings - Fork 1
/
warnings.out
2067 lines (2067 loc) · 176 KB
/
warnings.out
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
../kernel/src/arch/x86/idt/idt.cpp:10:13: warning: variable 'idt_entry_start' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
extern char idt_entry_start[];
^
../kernel/src/arch/x86/idt/idt.cpp:29:13: warning: variable 'handler' of type 'std::uint64_t' (aka 'unsigned long') can be declared 'const' [misc-const-correctness]
std::uint64_t handler = as_uptr(decay_arr(idt_entry_start)) + i * IDT_HANDLER_ASM_SIZE;
^
const
../kernel/src/arch/x86/idt/idt.cpp:38:9: warning: variable 'desc' of type 'utils::packed_tuple<std::uint16_t, std::uintptr_t>' (aka 'packed_tuple<unsigned short, unsigned long>') can be declared 'const' [misc-const-correctness]
utils::packed_tuple<std::uint16_t, std::uintptr_t> desc(sizeof(idt_entry) * IDT_ENTRIES, as_uptr(smp::core_local::get().idt_entries));
^
const
../kernel/src/arch/x86/idt/idt.cpp:57:9: warning: variable 'num' of type 'std::size_t' (aka 'unsigned long') can be declared 'const' [misc-const-correctness]
std::size_t num = local.irq_allocator.allocate();
^
const
../kernel/src/arch/x86/debug/symbols.cpp:32:41: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
entry* entries = as_ptr(ptr + 1);
^
../kernel/src/arch/x86/debug/symbols.cpp:41:21: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
if (entries[mid].start_addr > address)
^
../kernel/src/arch/x86/debug/symbols.cpp:51:17: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
if (entries[left].start_addr + entries[left].len > address)
^
../kernel/src/arch/x86/debug/symbols.cpp:51:44: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
if (entries[left].start_addr + entries[left].len > address)
^
../kernel/src/arch/x86/debug/symbols.cpp:53:65: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
return debug::symbol{as_ptr<const char>(symtab) + entries[left].name, static_cast<std::uint32_t>(address - entries[left].start_addr)};
^
../kernel/src/arch/x86/debug/symbols.cpp:53:67: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
return debug::symbol{as_ptr<const char>(symtab) + entries[left].name, static_cast<std::uint32_t>(address - entries[left].start_addr)};
^
../kernel/src/arch/x86/debug/symbols.cpp:53:124: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
return debug::symbol{as_ptr<const char>(symtab) + entries[left].name, static_cast<std::uint32_t>(address - entries[left].start_addr)};
^
../kernel/src/arch/x86/sync/spinlock.cpp:13:33: warning: narrowing conversion from 'std::size_t' (aka 'unsigned long') to signed type 'int' is implementation-defined [bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions]
if (!l.exchange(value, std::memory_order_acquire))
^
../kernel/src/arch/x86/debug/panic.cpp:31:13: warning: variable 'old_bp' of type 'std::size_t' (aka 'unsigned long') can be declared 'const' [misc-const-correctness]
std::size_t old_bp = base_ptr[0];
^
const
../kernel/src/arch/x86/debug/panic.cpp:31:34: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
std::size_t old_bp = base_ptr[0];
^
../kernel/src/arch/x86/debug/panic.cpp:32:13: warning: variable 'ret_addr' of type 'std::size_t' (aka 'unsigned long') can be declared 'const' [misc-const-correctness]
std::size_t ret_addr = base_ptr[1];
^
const
../kernel/src/arch/x86/debug/panic.cpp:32:36: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
std::size_t ret_addr = base_ptr[1];
^
../kernel/src/arch/x86/debug/panic.cpp:49:87: warning: do not use array subscript when the index is not an integer constant expression [cppcoreguidelines-pro-bounds-constant-array-index]
klog::log("stack type: " CYAN("%s") "\n", stack_color < sizeof(STACK_TYPES) ? STACK_TYPES[stack_color] : "unknown");
^
../kernel/src/arch/x86/debug/panic.cpp:64:37: warning: 5 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
for (std::size_t i = 0; i < 5; i++)
^
../kernel/src/arch/x86/debug/panic.cpp:66:71: warning: do not use array subscript when the index is not an integer constant expression [cppcoreguidelines-pro-bounds-constant-array-index]
klog::log("%3s=0x%016lx %3s=0x%016lx %3s=0x%016lx\n", proc::context::REGISTER_NAMES[i * 3], ctx->rgp[i * 3],
^
../kernel/src/arch/x86/debug/panic.cpp:66:109: warning: do not use array subscript when the index is not an integer constant expression [cppcoreguidelines-pro-bounds-constant-array-index]
klog::log("%3s=0x%016lx %3s=0x%016lx %3s=0x%016lx\n", proc::context::REGISTER_NAMES[i * 3], ctx->rgp[i * 3],
^
../kernel/src/arch/x86/debug/panic.cpp:67:23: warning: do not use array subscript when the index is not an integer constant expression [cppcoreguidelines-pro-bounds-constant-array-index]
proc::context::REGISTER_NAMES[i * 3 + 1], ctx->rgp[i * 3 + 1], proc::context::REGISTER_NAMES[i * 3 + 2], ctx->rgp[i * 3 + 2]);
^
../kernel/src/arch/x86/debug/panic.cpp:67:65: warning: do not use array subscript when the index is not an integer constant expression [cppcoreguidelines-pro-bounds-constant-array-index]
proc::context::REGISTER_NAMES[i * 3 + 1], ctx->rgp[i * 3 + 1], proc::context::REGISTER_NAMES[i * 3 + 2], ctx->rgp[i * 3 + 2]);
^
../kernel/src/arch/x86/debug/panic.cpp:67:86: warning: do not use array subscript when the index is not an integer constant expression [cppcoreguidelines-pro-bounds-constant-array-index]
proc::context::REGISTER_NAMES[i * 3 + 1], ctx->rgp[i * 3 + 1], proc::context::REGISTER_NAMES[i * 3 + 2], ctx->rgp[i * 3 + 2]);
^
../kernel/src/arch/x86/debug/panic.cpp:67:128: warning: do not use array subscript when the index is not an integer constant expression [cppcoreguidelines-pro-bounds-constant-array-index]
proc::context::REGISTER_NAMES[i * 3 + 1], ctx->rgp[i * 3 + 1], proc::context::REGISTER_NAMES[i * 3 + 2], ctx->rgp[i * 3 + 2]);
^
../kernel/src/arch/x86/apic/apic.cpp:27:39: warning: 0xff is a magic number; consider replacing it with a named constant [readability-magic-numbers]
outb(ioports::PIC_SLAVE_DATA, 0xff);
^
../kernel/src/arch/x86/apic/apic.cpp:28:40: warning: 0xff is a magic number; consider replacing it with a named constant [readability-magic-numbers]
outb(ioports::PIC_MASTER_DATA, 0xff);
^
../kernel/src/arch/x86/apic/apic.cpp:41:45: warning: 0b00110000 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
outb(ioports::PIT_MODE_COMMAND, 0b00110000);
^
../kernel/src/arch/x86/apic/apic.cpp:85:9: warning: variable 'ticks' of type 'std::uint64_t' (aka 'unsigned long') can be declared 'const' [misc-const-correctness]
std::uint64_t ticks = ~0U - mmio_register().current_timer_count;
^
const
../kernel/src/arch/x86/kinit/kinit.cpp:50:36: warning: variable 'buf' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
alignas(boot_resource) static char buf[sizeof(boot_resource)];
^
../kernel/src/arch/x86/kinit/kinit.cpp:50:36: warning: variable 'buf' declared 'static', move to anonymous namespace instead [misc-use-anonymous-namespace]
../kernel/src/arch/x86/kinit/kinit.cpp:52:82: warning: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay]
auto boot_resource::instance() -> boot_resource& { return *as_ptr<boot_resource>(buf); }
^
../kernel/src/arch/x86/kinit/kinit.cpp:56:33: warning: Access to field 'module_count' results in a dereference of a null pointer (loaded from field 'response') [clang-analyzer-core.NullDereference]
for (std::size_t i = 0; i < module_request.response->module_count; i++)
^
../kernel/src/arch/x86/kinit/kinit.cpp:139:19: note: Calling default constructor for 'boot_resource'
new (buf) boot_resource();
^~~~~~~~~~~~~~~
../kernel/src/arch/x86/kinit/kinit.cpp:65:16: note: Calling default constructor for 'modules'
boot_resource::boot_resource() : mmap_length(0), pmrs_length(0), mmap_entries(), smp_status(false)
^~~~~~~~~~~~~
../kernel/src/arch/x86/kinit/kinit.cpp:56:33: note: Access to field 'module_count' results in a dereference of a null pointer (loaded from field 'response')
for (std::size_t i = 0; i < module_request.response->module_count; i++)
^ ~~~~~~~~
../kernel/src/arch/x86/kinit/kinit.cpp:58:26: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
if (!std::strcmp(module_request.response->modules[i]->cmdline, "symbols"))
^
../kernel/src/arch/x86/kinit/kinit.cpp:60:23: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
symbols = module_request.response->modules[i]->address;
^
../kernel/src/arch/x86/kinit/kinit.cpp:78:9: warning: do not use array subscript when the index is not an integer constant expression [cppcoreguidelines-pro-bounds-constant-array-index]
mmap_entries[i] = *mmap_tag->entries[i];
^
../kernel/src/arch/x86/kinit/kinit.cpp:78:28: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
mmap_entries[i] = *mmap_tag->entries[i];
^
../kernel/src/arch/x86/kinit/kinit.cpp:92:21: warning: variable 'cpu0' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
smp::core_local cpu0;
^
../kernel/src/arch/x86/kinit/kinit.cpp:93:22: warning: variable 'cpu0_ptr' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
smp::core_local* cpu0_ptr = &cpu0;
^
../kernel/src/arch/x86/kinit/kinit.cpp:93:22: warning: variable 'cpu0_ptr' provides global access to a non-const object; consider making the pointed-to data 'const' [cppcoreguidelines-avoid-non-const-global-variables]
../kernel/src/arch/x86/kinit/kinit.cpp:98:9: warning: variable 'instance' of type 'boot_resource &' can be declared 'const' [misc-const-correctness]
boot_resource& instance = boot_resource::instance();
^
const
../kernel/src/arch/x86/kinit/kinit.cpp:101:13: warning: do not call c-style vararg functions [cppcoreguidelines-pro-type-vararg]
std::printf("WARN kinit: ");
^
../kernel/src/arch/x86/kinit/kinit.cpp:106:21: warning: do not call c-style vararg functions [cppcoreguidelines-pro-type-vararg]
std::printf("%s", flag.second); // input is sanitized
^
../kernel/src/arch/x86/kinit/kinit.cpp:110:13: warning: do not call c-style vararg functions [cppcoreguidelines-pro-type-vararg]
std::printf("\n");
^
../kernel/src/arch/x86/kinit/kinit.cpp:117:26: warning: declaration uses identifier '__start_init_array', which is a reserved identifier [bugprone-reserved-identifier,cert-dcl37-c,cert-dcl51-cpp]
extern std::uint64_t __start_init_array[];
^~~~~~~~~~~~~~~~~~
_start_init_array
../kernel/src/arch/x86/kinit/kinit.cpp:117:26: warning: variable '__start_init_array' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
../kernel/src/arch/x86/kinit/kinit.cpp:118:26: warning: declaration uses identifier '__end_init_array', which is a reserved identifier [bugprone-reserved-identifier,cert-dcl37-c,cert-dcl51-cpp]
extern std::uint64_t __end_init_array[];
^~~~~~~~~~~~~~~~
_end_init_array
../kernel/src/arch/x86/kinit/kinit.cpp:118:26: warning: variable '__end_init_array' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
../kernel/src/arch/x86/kinit/kinit.cpp:126:99: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
for (std::uintptr_t* i = as_ptr(&__start_init_array); i < as_ptr(&__end_init_array); i++)
^
../kernel/src/arch/x86/kinit/kinit.cpp:139:14: warning: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay]
new (buf) boot_resource();
^
../kernel/src/arch/x86/kinit/kinit.cpp:149:9: warning: do not call c-style vararg functions [cppcoreguidelines-pro-type-vararg]
std::printf("kinit: _start() started tty\n");
^
../kernel/src/arch/x86/kinit/kinit.cpp:150:9: warning: do not call c-style vararg functions [cppcoreguidelines-pro-type-vararg]
std::printf("booted from: %s-v%s\n", btl_info_request.response->name, btl_info_request.response->version);
^
../kernel/src/arch/x86/san/ubsan.cpp:119:5: warning: variable '__guard0' of type '::lock::spinlock_guard' (aka 'lock_guard<spinlock>') can be declared 'const' [misc-const-correctness]
SPINLOCK_SYNC_BLOCK;
^
../kernel/include/arch/x86/sync/spinlock.h:56:29: note: expanded from macro 'SPINLOCK_SYNC_BLOCK'
#define SPINLOCK_SYNC_BLOCK _SPINLOCK_SYNC_BLOCK(__COUNTER__)
^
../kernel/include/arch/x86/sync/spinlock.h:54:5: note: expanded from macro '_SPINLOCK_SYNC_BLOCK'
::lock::spinlock_guard CONCAT(__guard, n) { CONCAT(__lock, n) }
^
../kernel/src/arch/x86/san/ubsan.cpp:138:9: warning: variable 'lhs_typed' of type 'ubsan_typed_value' can be declared 'const' [misc-const-correctness]
ubsan_typed_value lhs_typed(*data->type, lhs);
^
const
../kernel/src/arch/x86/san/ubsan.cpp:139:9: warning: variable 'rhs_typed' of type 'ubsan_typed_value' can be declared 'const' [misc-const-correctness]
ubsan_typed_value rhs_typed(*data->type, rhs);
^
const
../kernel/src/arch/x86/san/ubsan.cpp:179:9: warning: variable 'lhs_typed' of type 'ubsan_typed_value' can be declared 'const' [misc-const-correctness]
ubsan_typed_value lhs_typed(*data->type, lhs);
^
const
../kernel/src/arch/x86/san/ubsan.cpp:180:9: warning: variable 'rhs_typed' of type 'ubsan_typed_value' can be declared 'const' [misc-const-correctness]
ubsan_typed_value rhs_typed(*data->type, rhs);
^
const
../kernel/src/arch/x86/san/ubsan.cpp:201:9: warning: variable 'val_typed' of type 'ubsan_typed_value' can be declared 'const' [misc-const-correctness]
ubsan_typed_value val_typed(*data->type, val);
^
const
../kernel/src/arch/x86/san/ubsan.cpp:272:9: warning: variable 'lhs_value' of type 'ubsan_typed_value' can be declared 'const' [misc-const-correctness]
ubsan_typed_value lhs_value(*data->lhs_type, lhs);
^
const
../kernel/src/arch/x86/san/ubsan.cpp:273:9: warning: variable 'rhs_value' of type 'ubsan_typed_value' can be declared 'const' [misc-const-correctness]
ubsan_typed_value rhs_value(*data->rhs_type, rhs);
^
const
../kernel/src/arch/x86/san/ubsan.cpp:340:9: warning: variable 'index' of type 'ubsan_typed_value' can be declared 'const' [misc-const-correctness]
ubsan_typed_value index(*data->index, val);
^
const
../kernel/src/arch/x86/san/ubsan.cpp:369:9: warning: variable 'alignment' of type 'std::uintptr_t' (aka 'unsigned long') can be declared 'const' [misc-const-correctness]
std::uintptr_t alignment = (std::uintptr_t)1 << data->log_alignment;
^
const
../kernel/src/arch/x86/san/ubsan.cpp:413:9: warning: variable 'value' of type 'ubsan_typed_value' can be declared 'const' [misc-const-correctness]
ubsan_typed_value value(*data->type, val);
^
const
../kernel/src/arch/x86/san/ubsan.cpp:516:104: warning: 2 adjacent parameters of '__ubsan_handle_alignment_assumption' of similar type ('value') are easily swapped by mistake [bugprone-easily-swappable-parameters]
C [[noreturn]] NO_UBSAN void __ubsan_handle_alignment_assumption(ubsan_alignment_assumption* data, value ptr, value align, value off)
^~~~~~~~~~~~~~~~~~~~~~
../kernel/src/arch/x86/san/ubsan.cpp:516:110: note: the first parameter in the range is 'ptr'
C [[noreturn]] NO_UBSAN void __ubsan_handle_alignment_assumption(ubsan_alignment_assumption* data, value ptr, value align, value off)
^~~
../kernel/src/arch/x86/san/ubsan.cpp:516:121: note: the last parameter in the range is 'align'
C [[noreturn]] NO_UBSAN void __ubsan_handle_alignment_assumption(ubsan_alignment_assumption* data, value ptr, value align, value off)
^~~~~
../kernel/src/arch/x86/san/ubsan.cpp:520:9: warning: variable 'real_ptr' of type 'std::uintptr_t' (aka 'unsigned long') can be declared 'const' [misc-const-correctness]
std::uintptr_t real_ptr = ptr - off;
^
const
../kernel/src/arch/x86/san/ubsan.cpp:521:9: warning: variable 'real_align' of type 'std::uintptr_t' (aka 'unsigned long') can be declared 'const' [misc-const-correctness]
std::uintptr_t real_align = std::uintptr_t(1) << __builtin_ctzl(real_ptr);
^
const
../kernel/src/arch/x86/san/ubsan.cpp:523:9: warning: variable 'align_mask' of type 'std::uintptr_t' (aka 'unsigned long') can be declared 'const' [misc-const-correctness]
std::uintptr_t align_mask = align - 1;
^
const
../kernel/src/arch/x86/san/ubsan.cpp:524:9: warning: variable 'misalign_off' of type 'std::uintptr_t' (aka 'unsigned long') can be declared 'const' [misc-const-correctness]
std::uintptr_t misalign_off = real_ptr & align_mask;
^
const
../kernel/src/arch/x86/debug/kinit_dump.cpp:15:9: warning: do not call c-style vararg functions [cppcoreguidelines-pro-type-vararg]
std::printf("kernel v%s (%s)\n", config::get_str<"version.full-version">, config::get_str<"arch">);
^
../kernel/src/arch/x86/debug/kinit_dump.cpp:16:9: warning: do not call c-style vararg functions [cppcoreguidelines-pro-type-vararg]
std::printf("built with cc: %s-%s cxx: %s-%s\n", config::get_str<"version.cc.id">, config::get_str<"version.cc.ver">,
^
../kernel/src/arch/x86/debug/kinit_dump.cpp:24:13: warning: do not call c-style vararg functions [cppcoreguidelines-pro-type-vararg]
std::printf("memory map:\n");
^
../kernel/src/arch/x86/debug/kinit_dump.cpp:30:21: warning: do not call c-style vararg functions [cppcoreguidelines-pro-type-vararg]
std::printf("[" CYAN("USABLE ") "]: ");
^
../kernel/src/arch/x86/debug/kinit_dump.cpp:33:21: warning: do not call c-style vararg functions [cppcoreguidelines-pro-type-vararg]
std::printf("[" RED("RESERVED ") "]: ");
^
../kernel/src/arch/x86/debug/kinit_dump.cpp:36:21: warning: do not call c-style vararg functions [cppcoreguidelines-pro-type-vararg]
std::printf("[" YELLOW("ACPI RECLAIM") "]: ");
^
../kernel/src/arch/x86/debug/kinit_dump.cpp:39:21: warning: do not call c-style vararg functions [cppcoreguidelines-pro-type-vararg]
std::printf("[" YELLOW("ACPI NVS ") "]: ");
^
../kernel/src/arch/x86/debug/kinit_dump.cpp:42:21: warning: do not call c-style vararg functions [cppcoreguidelines-pro-type-vararg]
std::printf("[" RED("BAD ") "]: ");
^
../kernel/src/arch/x86/debug/kinit_dump.cpp:45:21: warning: do not call c-style vararg functions [cppcoreguidelines-pro-type-vararg]
std::printf("[" YELLOW("BTL RECLAIM ") "]: ");
^
../kernel/src/arch/x86/debug/kinit_dump.cpp:48:21: warning: do not call c-style vararg functions [cppcoreguidelines-pro-type-vararg]
std::printf("[" CYAN("K/MOD ") "]: ");
^
../kernel/src/arch/x86/debug/kinit_dump.cpp:51:21: warning: do not call c-style vararg functions [cppcoreguidelines-pro-type-vararg]
std::printf("[" CYAN("FRAMEBUFFER ") "]: ");
^
../kernel/src/arch/x86/debug/kinit_dump.cpp:55:21: warning: do not call c-style vararg functions [cppcoreguidelines-pro-type-vararg]
std::printf("[" GRAY("UNKNOWN ") "]: ");
^
../kernel/src/arch/x86/debug/kinit_dump.cpp:57:17: warning: do not call c-style vararg functions [cppcoreguidelines-pro-type-vararg]
std::printf("0x%016lx-0x%016lx length=0x%016lx\n", entry.base, entry.base + entry.length, entry.length);
^
../kernel/src/arch/x86/debug/kinit_dump.cpp:66:13: warning: do not call c-style vararg functions [cppcoreguidelines-pro-type-vararg]
std::printf("cpu_vendor_string: %s\n", cpuid_info::cpu_vendor_string());
^
../kernel/src/arch/x86/debug/kinit_dump.cpp:67:13: warning: do not call c-style vararg functions [cppcoreguidelines-pro-type-vararg]
std::printf("cpu_brand_string: %s\n", cpuid_info::cpu_brand_string());
^
../kernel/src/arch/x86/debug/kinit_dump.cpp:69:13: warning: do not call c-style vararg functions [cppcoreguidelines-pro-type-vararg]
std::printf("cpu features: ");
^
../kernel/src/arch/x86/debug/kinit_dump.cpp:74:21: warning: do not call c-style vararg functions [cppcoreguidelines-pro-type-vararg]
std::printf("%s ", cpuid_info::FEATURE_STRINGS.at(i));
^
../kernel/src/arch/x86/debug/kinit_dump.cpp:78:13: warning: do not call c-style vararg functions [cppcoreguidelines-pro-type-vararg]
std::printf("\n");
^
../kernel/src/arch/x86/debug/kinit_dump.cpp:87:13: warning: do not call c-style vararg functions [cppcoreguidelines-pro-type-vararg]
std::printf("ACPI info (0x%016lx):\n", rsdp->xsdt_address);
^
../kernel/src/arch/x86/debug/kinit_dump.cpp:88:13: warning: do not call c-style vararg functions [cppcoreguidelines-pro-type-vararg]
std::printf(" rsdp data:\n");
^
../kernel/src/arch/x86/debug/kinit_dump.cpp:89:13: warning: do not call c-style vararg functions [cppcoreguidelines-pro-type-vararg]
std::printf(" revision=%d\n", (int)rsdp->revision);
^
../kernel/src/arch/x86/debug/kinit_dump.cpp:90:13: warning: do not call c-style vararg functions [cppcoreguidelines-pro-type-vararg]
std::printf(" length=%d\n", (int)rsdp->length);
^
../kernel/src/arch/x86/debug/kinit_dump.cpp:94:17: warning: variable 'signature_ptr' of type 'std::span<const char>' can be declared 'const' [misc-const-correctness]
std::span<const char> signature_ptr(cast_ptr<const char>(&signature), 4);
^
const
../kernel/src/arch/x86/debug/kinit_dump.cpp:96:17: warning: do not call c-style vararg functions [cppcoreguidelines-pro-type-vararg]
std::printf(" entry: (sig=0x%08x '%c%c%c%c')\n", signature, signature_ptr[0], signature_ptr[1], signature_ptr[2], signature_ptr[3]);
^
../kernel/src/arch/x86/process/process.cpp:12:17: warning: declaration uses identifier '__save_ctx_for_reschedule', which is a reserved identifier [bugprone-reserved-identifier,cert-dcl37-c,cert-dcl51-cpp]
extern "C" auto __save_ctx_for_reschedule() -> std::uint64_t;
^~~~~~~~~~~~~~~~~~~~~~~~~
_save_ctx_for_reschedule
../kernel/src/arch/x86/process/process.cpp:16:20: warning: variable 'processes' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
static process processes[2];
^
../kernel/src/arch/x86/process/process.cpp:16:20: warning: variable 'processes' declared 'static', move to anonymous namespace instead [misc-use-anonymous-namespace]
../kernel/src/arch/x86/process/process.cpp:20:9: warning: variable '__guard0' of type '::lock::spinlock_guard' (aka 'lock_guard<spinlock>') can be declared 'const' [misc-const-correctness]
SPINLOCK_SYNC_BLOCK;
^
../kernel/include/arch/x86/sync/spinlock.h:56:29: note: expanded from macro 'SPINLOCK_SYNC_BLOCK'
#define SPINLOCK_SYNC_BLOCK _SPINLOCK_SYNC_BLOCK(__COUNTER__)
^
../kernel/include/arch/x86/sync/spinlock.h:54:5: note: expanded from macro '_SPINLOCK_SYNC_BLOCK'
::lock::spinlock_guard CONCAT(__guard, n) { CONCAT(__lock, n) }
^
../kernel/src/arch/x86/process/process.cpp:22:9: warning: variable 'tid' of type 'std::size_t' (aka 'unsigned long') can be declared 'const' [misc-const-correctness]
std::size_t tid = thread_allocator.allocate();
^
const
../kernel/src/arch/x86/process/process.cpp:28:9: warning: variable 'id32' of type 'std::uint32_t' (aka 'unsigned int') can be declared 'const' [misc-const-correctness]
std::uint32_t id32 = tid;
^
const
../kernel/src/arch/x86/process/process.cpp:30:9: warning: use auto when initializing with new to avoid duplicating the type name [modernize-use-auto]
gsl::owner<thread*> th = new thread({id32, pid});
^~~~~~~~~~~~~~~~~~~
auto
../kernel/src/arch/x86/process/process.cpp:30:29: warning: variable name 'th' is too short, expected at least 3 characters [readability-identifier-length]
gsl::owner<thread*> th = new thread({id32, pid});
^
../kernel/src/arch/x86/process/process.cpp:31:9: warning: do not use array subscript when the index is not an integer constant expression [cppcoreguidelines-pro-bounds-constant-array-index]
threads[tid] = th;
^
../kernel/src/arch/x86/process/process.cpp:41:9: warning: do not use array subscript when the index is not an integer constant expression [cppcoreguidelines-pro-bounds-constant-array-index]
processes[pid].pid = pid;
^
../kernel/src/arch/x86/process/process.cpp:42:16: warning: do not use array subscript when the index is not an integer constant expression [cppcoreguidelines-pro-bounds-constant-array-index]
return processes[pid];
^
../kernel/src/arch/x86/tty/tty.cpp:11:58: warning: variable 'framebuffer_request' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
[[gnu::used]] volatile static limine_framebuffer_request framebuffer_request{
^
../kernel/src/arch/x86/tty/tty.cpp:11:58: warning: variable 'framebuffer_request' declared 'static', move to anonymous namespace instead [misc-use-anonymous-namespace]
../kernel/src/arch/x86/tty/tty.cpp:19:26: warning: variable 'ansi_colors' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
static std::uint32_t ansi_colors[8] = {
^
../kernel/src/arch/x86/tty/tty.cpp:19:26: warning: variable 'ansi_colors' declared 'static', move to anonymous namespace instead [misc-use-anonymous-namespace]
../kernel/src/arch/x86/tty/tty.cpp:20:9: warning: 0x00131a1c is a magic number; consider replacing it with a named constant [readability-magic-numbers]
0x00131a1c, 0x00e74c4c, 0x006bb05d, 0x00e59e67, 0x005b98a9, 0x00b185db, 0x0051a39f, 0x00c4c4c4,
^
../kernel/src/arch/x86/tty/tty.cpp:20:21: warning: 0x00e74c4c is a magic number; consider replacing it with a named constant [readability-magic-numbers]
0x00131a1c, 0x00e74c4c, 0x006bb05d, 0x00e59e67, 0x005b98a9, 0x00b185db, 0x0051a39f, 0x00c4c4c4,
^
../kernel/src/arch/x86/tty/tty.cpp:20:33: warning: 0x006bb05d is a magic number; consider replacing it with a named constant [readability-magic-numbers]
0x00131a1c, 0x00e74c4c, 0x006bb05d, 0x00e59e67, 0x005b98a9, 0x00b185db, 0x0051a39f, 0x00c4c4c4,
^
../kernel/src/arch/x86/tty/tty.cpp:20:45: warning: 0x00e59e67 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
0x00131a1c, 0x00e74c4c, 0x006bb05d, 0x00e59e67, 0x005b98a9, 0x00b185db, 0x0051a39f, 0x00c4c4c4,
^
../kernel/src/arch/x86/tty/tty.cpp:20:57: warning: 0x005b98a9 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
0x00131a1c, 0x00e74c4c, 0x006bb05d, 0x00e59e67, 0x005b98a9, 0x00b185db, 0x0051a39f, 0x00c4c4c4,
^
../kernel/src/arch/x86/tty/tty.cpp:20:69: warning: 0x00b185db is a magic number; consider replacing it with a named constant [readability-magic-numbers]
0x00131a1c, 0x00e74c4c, 0x006bb05d, 0x00e59e67, 0x005b98a9, 0x00b185db, 0x0051a39f, 0x00c4c4c4,
^
../kernel/src/arch/x86/tty/tty.cpp:20:81: warning: 0x0051a39f is a magic number; consider replacing it with a named constant [readability-magic-numbers]
0x00131a1c, 0x00e74c4c, 0x006bb05d, 0x00e59e67, 0x005b98a9, 0x00b185db, 0x0051a39f, 0x00c4c4c4,
^
../kernel/src/arch/x86/tty/tty.cpp:20:93: warning: 0x00c4c4c4 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
0x00131a1c, 0x00e74c4c, 0x006bb05d, 0x00e59e67, 0x005b98a9, 0x00b185db, 0x0051a39f, 0x00c4c4c4,
^
../kernel/src/arch/x86/tty/tty.cpp:23:26: warning: variable 'ansi_bright_colours' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
static std::uint32_t ansi_bright_colours[8] = {
^
../kernel/src/arch/x86/tty/tty.cpp:23:26: warning: variable 'ansi_bright_colours' declared 'static', move to anonymous namespace instead [misc-use-anonymous-namespace]
../kernel/src/arch/x86/tty/tty.cpp:24:9: warning: 0x00343636 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
0x00343636, 0x00c26f6f, 0x008dc776, 0x00e7ac7e, 0x007ab3c3, 0x00bb84e5, 0x006db0ad, 0x00cccccc,
^
../kernel/src/arch/x86/tty/tty.cpp:24:21: warning: 0x00c26f6f is a magic number; consider replacing it with a named constant [readability-magic-numbers]
0x00343636, 0x00c26f6f, 0x008dc776, 0x00e7ac7e, 0x007ab3c3, 0x00bb84e5, 0x006db0ad, 0x00cccccc,
^
../kernel/src/arch/x86/tty/tty.cpp:24:33: warning: 0x008dc776 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
0x00343636, 0x00c26f6f, 0x008dc776, 0x00e7ac7e, 0x007ab3c3, 0x00bb84e5, 0x006db0ad, 0x00cccccc,
^
../kernel/src/arch/x86/tty/tty.cpp:24:45: warning: 0x00e7ac7e is a magic number; consider replacing it with a named constant [readability-magic-numbers]
0x00343636, 0x00c26f6f, 0x008dc776, 0x00e7ac7e, 0x007ab3c3, 0x00bb84e5, 0x006db0ad, 0x00cccccc,
^
../kernel/src/arch/x86/tty/tty.cpp:24:57: warning: 0x007ab3c3 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
0x00343636, 0x00c26f6f, 0x008dc776, 0x00e7ac7e, 0x007ab3c3, 0x00bb84e5, 0x006db0ad, 0x00cccccc,
^
../kernel/src/arch/x86/tty/tty.cpp:24:69: warning: 0x00bb84e5 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
0x00343636, 0x00c26f6f, 0x008dc776, 0x00e7ac7e, 0x007ab3c3, 0x00bb84e5, 0x006db0ad, 0x00cccccc,
^
../kernel/src/arch/x86/tty/tty.cpp:24:81: warning: 0x006db0ad is a magic number; consider replacing it with a named constant [readability-magic-numbers]
0x00343636, 0x00c26f6f, 0x008dc776, 0x00e7ac7e, 0x007ab3c3, 0x00bb84e5, 0x006db0ad, 0x00cccccc,
^
../kernel/src/arch/x86/tty/tty.cpp:24:93: warning: 0x00cccccc is a magic number; consider replacing it with a named constant [readability-magic-numbers]
0x00343636, 0x00c26f6f, 0x008dc776, 0x00e7ac7e, 0x007ab3c3, 0x00bb84e5, 0x006db0ad, 0x00cccccc,
^
../kernel/src/arch/x86/tty/tty.cpp:27:26: warning: variable 'default_bg' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
static std::uint32_t default_bg = 0x00131a1c;
^
../kernel/src/arch/x86/tty/tty.cpp:27:26: warning: variable 'default_bg' declared 'static', move to anonymous namespace instead [misc-use-anonymous-namespace]
../kernel/src/arch/x86/tty/tty.cpp:27:39: warning: 0x00131a1c is a magic number; consider replacing it with a named constant [readability-magic-numbers]
static std::uint32_t default_bg = 0x00131a1c;
^
../kernel/src/arch/x86/tty/tty.cpp:28:26: warning: variable 'default_fg' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
static std::uint32_t default_fg = 0x00c5c8c9;
^
../kernel/src/arch/x86/tty/tty.cpp:28:26: warning: variable 'default_fg' declared 'static', move to anonymous namespace instead [misc-use-anonymous-namespace]
../kernel/src/arch/x86/tty/tty.cpp:28:39: warning: 0x00c5c8c9 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
static std::uint32_t default_fg = 0x00c5c8c9;
^
../kernel/src/arch/x86/tty/tty.cpp:29:26: warning: variable 'ctx' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
static term_context* ctx;
^
../kernel/src/arch/x86/tty/tty.cpp:29:26: warning: variable 'ctx' provides global access to a non-const object; consider making the pointed-to data 'const' [cppcoreguidelines-avoid-non-const-global-variables]
../kernel/src/arch/x86/tty/tty.cpp:29:26: warning: variable 'ctx' declared 'static', move to anonymous namespace instead [misc-use-anonymous-namespace]
../kernel/src/arch/x86/tty/tty.cpp:33:15: warning: variable name 'fb' is too short, expected at least 3 characters [readability-identifier-length]
auto* fb = framebuffer_request.response->framebuffers[0];
^
../kernel/src/arch/x86/tty/tty.cpp:33:20: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
auto* fb = framebuffer_request.response->framebuffers[0];
^
../kernel/src/arch/x86/tty/tty.cpp:39:17: warning: variable 'pages' of type 'std::size_t' (aka 'unsigned long') can be declared 'const' [misc-const-correctness]
std::size_t pages = std::div_roundup(size, paging::PAGE_SMALL_SIZE);
^
const
../kernel/src/arch/x86/tty/tty.cpp:43:27: warning: variable name 'p' is too short, expected at least 3 characters [readability-identifier-length]
auto* p = mm::pmm_allocate();
^
../kernel/src/arch/x86/tty/tty.cpp:49:111: warning: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay]
mm::make_virtual<std::uint32_t>(as_uptr(fb->address)), fb->width, fb->height, fb->pitch, nullptr, ansi_colors, ansi_bright_colours,
^
../kernel/src/arch/x86/tty/tty.cpp:49:124: warning: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay]
mm::make_virtual<std::uint32_t>(as_uptr(fb->address)), fb->width, fb->height, fb->pitch, nullptr, ansi_colors, ansi_bright_colours,
^
../kernel/src/arch/x86/tty/tty.cpp:50:39: warning: do not use const_cast [cppcoreguidelines-pro-type-const-cast]
&default_bg, &default_fg, const_cast<void*>(as_vptr(decay_arr(font))), 8, 8, 0, 1, 1, 0);
^
../kernel/src/arch/x86/process/scheduler/scheduler.cpp:94:9: warning: variable '__guard0' of type '::lock::spinlock_guard' (aka 'lock_guard<spinlock>') can be declared 'const' [misc-const-correctness]
SPINLOCK_SYNC_BLOCK;
^
../kernel/include/arch/x86/sync/spinlock.h:56:29: note: expanded from macro 'SPINLOCK_SYNC_BLOCK'
#define SPINLOCK_SYNC_BLOCK _SPINLOCK_SYNC_BLOCK(__COUNTER__)
^
../kernel/include/arch/x86/sync/spinlock.h:54:5: note: expanded from macro '_SPINLOCK_SYNC_BLOCK'
::lock::spinlock_guard CONCAT(__guard, n) { CONCAT(__lock, n) }
^
../kernel/src/arch/x86/process/scheduler/scheduler.cpp:127:9: warning: expected assignment source to be of type 'gsl::owner<>'; got 'context *' [cppcoreguidelines-owning-memory]
local.ctxbuffer = &next_thread->ctx;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../kernel/src/arch/x86/pci/pci_scan.cpp:10:14: warning: function 'check_function' is within a recursive call chain [misc-no-recursion]
void check_function(pci_device_ident dev, std::uint8_t function, int level)
^
../kernel/src/arch/x86/pci/pci_scan.cpp:32:14: note: example recursive call chain, starting from function 'check_device'
void check_device(pci_device_ident dev, int level)
^
../kernel/src/arch/x86/pci/pci_scan.cpp:38:13: note: Frame #1: function 'check_device' calls function 'check_function' here:
check_function(dev, 0, level);
^
../kernel/src/arch/x86/pci/pci_scan.cpp:21:17: note: Frame #2: function 'check_function' calls function 'check_bus' here:
check_bus(secondary_bus, level + 1);
^
../kernel/src/arch/x86/pci/pci_scan.cpp:55:17: note: Frame #3: function 'check_bus' calls function 'check_device' here:
check_device({bus, device}, level);
^
../kernel/src/arch/x86/pci/pci_scan.cpp:55:17: note: ... which was the starting point of the recursive call chain; there may be other cycles
../kernel/src/arch/x86/pci/pci_scan.cpp:12:46: warning: 0x6 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
if ((dev.class_code(function) == 0x6) && (dev.subclass(function) == 0x4))
^
../kernel/src/arch/x86/pci/pci_scan.cpp:14:17: warning: variable 'secondary_bus' of type 'std::uint8_t' (aka 'unsigned char') can be declared 'const' [misc-const-correctness]
std::uint8_t secondary_bus = dev.read_config(function, 0x18) >> 8;
^
const
../kernel/src/arch/x86/pci/pci_scan.cpp:14:72: warning: 0x18 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
std::uint8_t secondary_bus = dev.read_config(function, 0x18) >> 8;
^
../kernel/src/arch/x86/pci/pci_scan.cpp:17:21: warning: do not call c-style vararg functions [cppcoreguidelines-pro-type-vararg]
std::printf("[PCI]%*c%02hhx:%02hhx.%hhx: bridge dev=%02hx:%02hhx-r%02hhx\n bus=%02hhx", level, ' ', dev.bus(), dev.slot(),
^
../kernel/src/arch/x86/pci/pci_scan.cpp:26:17: warning: do not call c-style vararg functions [cppcoreguidelines-pro-type-vararg]
std::printf("[PCI]%*c%02hhx:%02hhx.%hhx: class=%02hhx:%02hhx dev=%02hx:%02hhx-r%02hhx\n", level, ' ', dev.bus(), dev.slot(), function,
^
../kernel/src/arch/x86/pci/pci_scan.cpp:32:14: warning: function 'check_device' is within a recursive call chain [misc-no-recursion]
void check_device(pci_device_ident dev, int level)
^
../kernel/src/arch/x86/pci/pci_scan.cpp:34:37: warning: 0xFFFF is a magic number; consider replacing it with a named constant [readability-magic-numbers]
if (dev.vendor_id(0) == 0xFFFF)
^
../kernel/src/arch/x86/pci/pci_scan.cpp:43:52: warning: 0xFFFF is a magic number; consider replacing it with a named constant [readability-magic-numbers]
if (dev.vendor_id(function) != 0xFFFF)
^
../kernel/src/arch/x86/pci/pci_scan.cpp:51:14: warning: function 'check_bus' is within a recursive call chain [misc-no-recursion]
void check_bus(std::uint8_t bus, int level)
^
../kernel/src/arch/x86/pci/pci_scan.cpp:62:9: warning: variable 'root' of type 'pci_device_ident' can be declared 'const' [misc-const-correctness]
pci_device_ident root{0, 0};
^
const
../kernel/src/arch/x86/pci/pci_scan.cpp:71:49: warning: 0xFFFF is a magic number; consider replacing it with a named constant [readability-magic-numbers]
if (root.vendor_id(function) != 0xFFFF)
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/common/tty.h:11:11: warning: class 'romfont' defines a copy constructor and a move constructor but does not define a destructor, a copy assignment operator or a move assignment operator [cppcoreguidelines-special-member-functions]
class romfont
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/common/tty.h:23:27: warning: 2 adjacent parameters of 'romfont' of similar type ('std::uint8_t') are easily swapped by mistake [bugprone-easily-swappable-parameters]
constexpr romfont(std::uint8_t w, std::uint8_t h) : font_width(w), font_height(h), font(nullptr) {}
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/common/tty.h:23:40: note: the first parameter in the range is 'w'
constexpr romfont(std::uint8_t w, std::uint8_t h) : font_width(w), font_height(h), font(nullptr) {}
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/common/tty.h:23:56: note: the last parameter in the range is 'h'
constexpr romfont(std::uint8_t w, std::uint8_t h) : font_width(w), font_height(h), font(nullptr) {}
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/common/tty.h:23:40: warning: parameter name 'w' is too short, expected at least 3 characters [readability-identifier-length]
constexpr romfont(std::uint8_t w, std::uint8_t h) : font_width(w), font_height(h), font(nullptr) {}
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/common/tty.h:23:56: warning: parameter name 'h' is too short, expected at least 3 characters [readability-identifier-length]
constexpr romfont(std::uint8_t w, std::uint8_t h) : font_width(w), font_height(h), font(nullptr) {}
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/common/tty.h:29:27: warning: 2 adjacent parameters of 'romfont' of similar type ('std::uint8_t') are easily swapped by mistake [bugprone-easily-swappable-parameters]
constexpr romfont(std::uint8_t w, std::uint8_t h, void* n) : font_width(w), font_height(h), font(n) {}
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/common/tty.h:29:40: note: the first parameter in the range is 'w'
constexpr romfont(std::uint8_t w, std::uint8_t h, void* n) : font_width(w), font_height(h), font(n) {}
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/common/tty.h:29:56: note: the last parameter in the range is 'h'
constexpr romfont(std::uint8_t w, std::uint8_t h, void* n) : font_width(w), font_height(h), font(n) {}
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/common/tty.h:29:40: warning: parameter name 'w' is too short, expected at least 3 characters [readability-identifier-length]
constexpr romfont(std::uint8_t w, std::uint8_t h, void* n) : font_width(w), font_height(h), font(n) {}
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/common/tty.h:29:56: warning: parameter name 'h' is too short, expected at least 3 characters [readability-identifier-length]
constexpr romfont(std::uint8_t w, std::uint8_t h, void* n) : font_width(w), font_height(h), font(n) {}
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/common/tty.h:29:65: warning: parameter name 'n' is too short, expected at least 3 characters [readability-identifier-length]
constexpr romfont(std::uint8_t w, std::uint8_t h, void* n) : font_width(w), font_height(h), font(n) {}
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/common/tty.h:35:42: warning: parameter name 'f' is too short, expected at least 3 characters [readability-identifier-length]
constexpr romfont(const romfont& f) = default;
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/common/tty.h:38:37: warning: parameter name 'f' is too short, expected at least 3 characters [readability-identifier-length]
constexpr romfont(romfont&& f) = default;
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/common/tty.h:42:9: warning: function 'width' should be marked [[nodiscard]] [modernize-use-nodiscard]
constexpr std::uint8_t width() const { return font_width; }
^
[[nodiscard]]
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/common/tty.h:42:32: warning: use a trailing return type for this function [modernize-use-trailing-return-type]
constexpr std::uint8_t width() const { return font_width; }
~~~~~~~~~~~~ ^
auto -> std::uint8_t
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/common/tty.h:46:9: warning: function 'height' should be marked [[nodiscard]] [modernize-use-nodiscard]
constexpr std::uint8_t height() const { return font_height; }
^
[[nodiscard]]
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/common/tty.h:46:32: warning: use a trailing return type for this function [modernize-use-trailing-return-type]
constexpr std::uint8_t height() const { return font_height; }
~~~~~~~~~~~~ ^
auto -> std::uint8_t
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/common/tty.h:50:9: warning: function 'bpc' should be marked [[nodiscard]] [modernize-use-nodiscard]
constexpr std::size_t bpc() const { return (font_width * font_height) >> 3; }
^
[[nodiscard]]
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/common/tty.h:50:31: warning: use a trailing return type for this function [modernize-use-trailing-return-type]
constexpr std::size_t bpc() const { return (font_width * font_height) >> 3; }
~~~~~~~~~~~ ^
auto -> std::size_t
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/common/tty.h:59:9: warning: function 'char_at' should be marked [[nodiscard]] [modernize-use-nodiscard]
char* char_at(char ch) const { return &(cast_ptr<char>(font))[ch * bpc()]; }
^
[[nodiscard]]
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/common/tty.h:59:15: warning: use a trailing return type for this function [modernize-use-trailing-return-type]
char* char_at(char ch) const { return &(cast_ptr<char>(font))[ch * bpc()]; }
~~~~~ ^
auto -> char*
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/common/tty.h:59:48: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
char* char_at(char ch) const { return &(cast_ptr<char>(font))[ch * bpc()]; }
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/common/elf/elf.h:34:26: warning: 7 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
std::uint8_t pad[7]; // sakyua moment
^
../kernel/src/arch/x86/mm/mm.cpp:18:9: warning: variable 'index' of type 'std::size_t' (aka 'unsigned long') can be declared 'const' [misc-const-correctness]
std::size_t index = std::first_set_bit(bitmask);
^
const
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/common/misc/cast.h:26:12: warning: integer to pointer cast pessimizes optimization opportunities [performance-no-int-to-ptr]
return reinterpret_cast<T*>(ptr);
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/common/misc/cast.h:29:82: warning: integer to pointer cast pessimizes optimization opportunities [performance-no-int-to-ptr]
inline auto as_ptr(std::uintptr_t ptr) { return detail::_castable_to_any_pointer(reinterpret_cast<void*>(ptr)); }
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/common/misc/cast.h:55:59: warning: integer to pointer cast pessimizes optimization opportunities [performance-no-int-to-ptr]
inline auto as_vptr(std::uintptr_t ptr) -> void* { return reinterpret_cast<void*>(ptr); }
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/idt/idt.h:57:53: warning: 13 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
return 0x8000 | ((std::uint16_t)_dpl << 13) | ((std::uint16_t)gate << 8) | _ist;
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/idt/idt.h:75:28: warning: constructor does not initialize these fields: offset_low, flags, offset_mid, offset_high, reserved [cppcoreguidelines-pro-type-member-init]
struct [[gnu::packed]] idt_entry
^
../kernel/src/arch/x86/mm/malloc.cpp:22:23: warning: variable 'root' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
block_header* root = nullptr;
^
../kernel/src/arch/x86/mm/malloc.cpp:22:23: warning: variable 'root' provides global access to a non-const object; consider making the pointed-to data 'const' [cppcoreguidelines-avoid-non-const-global-variables]
../kernel/src/arch/x86/mm/malloc.cpp:23:23: warning: variable 'last' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
block_header* last = nullptr;
^
../kernel/src/arch/x86/mm/malloc.cpp:23:23: warning: variable 'last' provides global access to a non-const object; consider making the pointed-to data 'const' [cppcoreguidelines-avoid-non-const-global-variables]
../kernel/src/arch/x86/mm/malloc.cpp:24:21: warning: variable 'malloced_bytes' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
std::size_t malloced_bytes = 0;
^
../kernel/src/arch/x86/mm/malloc.cpp:28:33: warning: function 'next_of' declared 'static', move to anonymous namespace instead [misc-use-anonymous-namespace]
inline static block_header* next_of(block_header* header) { return as_ptr(as_uptr(header) + sizeof(block_header) + (header->size & ~1)); }
^
../kernel/src/arch/x86/mm/malloc.cpp:28:33: warning: use a trailing return type for this function [modernize-use-trailing-return-type]
inline static block_header* next_of(block_header* header) { return as_ptr(as_uptr(header) + sizeof(block_header) + (header->size & ~1)); }
~~~~~~~~~~~~~ ^
auto -> block_header*
../kernel/src/arch/x86/mm/malloc.cpp:30:24: warning: function 'extend' declared 'static', move to anonymous namespace instead [misc-use-anonymous-namespace]
inline static auto extend(void* buf, std::size_t size) -> std::size_t
^
../kernel/src/arch/x86/mm/malloc.cpp:30:37: warning: parameter 'buf' is unused [misc-unused-parameters]
inline static auto extend(void* buf, std::size_t size) -> std::size_t
~~~~~~^~~~~
../kernel/src/arch/x86/mm/malloc.cpp:32:9: warning: variable 'pages' of type 'std::size_t' (aka 'unsigned long') can be declared 'const' [misc-const-correctness]
std::size_t pages = std::div_roundup(size, paging::PAGE_SMALL_SIZE);
^
const
../kernel/src/arch/x86/mm/malloc.cpp:48:53: warning: assigning newly created 'gsl::owner<>' to non-owner 'block_header *' [cppcoreguidelines-owning-memory]
void init(void* ptr, std::size_t size) { root = last = new (ptr) block_header{(size - sizeof(block_header)) | 1, nullptr}; }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../kernel/src/arch/x86/mm/malloc.cpp:69:17: warning: variable 'bsize' of type 'std::size_t' (aka 'unsigned long') can be declared 'const' [misc-const-correctness]
std::size_t bsize = hdr->size & ~1;
^
const
../kernel/src/arch/x86/mm/malloc.cpp:73:21: warning: use auto when initializing with new to avoid duplicating the type name [modernize-use-auto]
gsl::owner<block_header*> next_block = new (next_of(hdr)) block_header{(bsize - size - sizeof(block_header)) | 1, hdr};
^~~~~~~~~~~~~~~~~~~~~~~~~
auto
../kernel/src/arch/x86/mm/malloc.cpp:86:31: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
return (void*)++hdr;
^
../kernel/src/arch/x86/mm/malloc.cpp:92:9: warning: variable 'new_size' of type 'std::size_t' (aka 'unsigned long') can be declared 'const' [misc-const-correctness]
std::size_t new_size = extend((void*)next_of(last), size + 0x100) & ~7;
^
const
../kernel/src/arch/x86/mm/malloc.cpp:92:78: warning: 7 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
std::size_t new_size = extend((void*)next_of(last), size + 0x100) & ~7;
^
../kernel/src/arch/x86/mm/malloc.cpp:95:13: warning: initializing non-owner 'block_header *' with a newly created 'gsl::owner<>' [cppcoreguidelines-owning-memory]
auto* u = new (next_of(last)) block_header{size & ~1, last};
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../kernel/src/arch/x86/mm/malloc.cpp:95:19: warning: variable name 'u' is too short, expected at least 3 characters [readability-identifier-length]
auto* u = new (next_of(last)) block_header{size & ~1, last};
^
../kernel/src/arch/x86/mm/malloc.cpp:96:13: warning: initializing non-owner 'block_header *' with a newly created 'gsl::owner<>' [cppcoreguidelines-owning-memory]
auto* l = new (next_of(u)) block_header{(new_size - size - 2 * sizeof(block_header)) | 1, u};
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../kernel/src/arch/x86/mm/malloc.cpp:96:19: warning: variable name 'l' is too short, expected at least 3 characters [readability-identifier-length]
auto* l = new (next_of(u)) block_header{(new_size - size - 2 * sizeof(block_header)) | 1, u};
^
../kernel/src/arch/x86/mm/malloc.cpp:98:27: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
return (void*)++u;
^
../kernel/src/arch/x86/mm/malloc.cpp:100:9: warning: do not use 'else' after 'return' [readability-else-after-return]
else
^~~~
../kernel/src/arch/x86/mm/malloc.cpp:102:13: warning: variable 'bsize' of type 'std::size_t' (aka 'unsigned long') can be declared 'const' [misc-const-correctness]
std::size_t bsize = ((last->size & ~1) + new_size) - sizeof(block_header) - size;
^
note: this fix will not be applied because it overlaps with another fix
../kernel/src/arch/x86/mm/malloc.cpp:104:13: warning: initializing non-owner 'block_header *' with a newly created 'gsl::owner<>' [cppcoreguidelines-owning-memory]
auto* l = new (next_of(last)) block_header{bsize | 1, last};
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../kernel/src/arch/x86/mm/malloc.cpp:104:19: warning: variable name 'l' is too short, expected at least 3 characters [readability-identifier-length]
auto* l = new (next_of(last)) block_header{bsize | 1, last};
^
../kernel/src/arch/x86/mm/malloc.cpp:106:19: warning: variable name 'u' is too short, expected at least 3 characters [readability-identifier-length]
auto* u = last;
^
../kernel/src/arch/x86/mm/malloc.cpp:108:27: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
return (void*)++u;
^
../kernel/src/arch/x86/mm/malloc.cpp:120:9: warning: variable 'aligned_ptr' of type 'std::uintptr_t' (aka 'unsigned long') can be declared 'const' [misc-const-correctness]
std::uintptr_t aligned_ptr = std::div_roundup(ptr, align);
^
const
../kernel/src/arch/x86/mm/malloc.cpp:125:13: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
as_ptr<std::uintptr_t>(aligned_ptr)[-1] = ptr | 1;
^
../kernel/src/arch/x86/mm/malloc.cpp:133:55: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
block_header* hdr = as_ptr<block_header>(buf) - 1;
^
../kernel/src/arch/x86/mm/malloc.cpp:143:13: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
target[i] = src[i];
^
../kernel/src/arch/x86/mm/malloc.cpp:143:25: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
target[i] = src[i];
^
../kernel/src/arch/x86/mm/malloc.cpp:155:13: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
if (as_ptr<std::uintptr_t>(buffer)[-1])
^
../kernel/src/arch/x86/mm/malloc.cpp:157:30: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
buffer = as_vptr(as_ptr<std::uintptr_t>(buffer)[-1] & ~1);
^
../kernel/src/arch/x86/mm/malloc.cpp:160:50: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
auto* type = as_ptr<std::size_t>(buffer) - 1;
^
../kernel/src/arch/x86/mm/malloc.cpp:161:50: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
auto* hdr = as_ptr<block_header>(buffer) - 1;
^
../kernel/src/arch/x86/mm/malloc.cpp:170:9: warning: variable 'is_prev' of type 'bool' can be declared 'const' [misc-const-correctness]
bool is_prev = hdr->back ? hdr->back->size & 1 : false;
^
const
../kernel/src/arch/x86/mm/malloc.cpp:170:24: warning: implicit conversion 'block_header *' -> bool [readability-implicit-bool-conversion]
bool is_prev = hdr->back ? hdr->back->size & 1 : false;
^
!= nullptr
../kernel/src/arch/x86/mm/malloc.cpp:170:24: warning: implicit conversion 'std::size_t' (aka 'unsigned long') -> bool [readability-implicit-bool-conversion]
bool is_prev = hdr->back ? hdr->back->size & 1 : false;
^
!= 0u
../kernel/src/arch/x86/mm/malloc.cpp:170:58: warning: implicit conversion bool -> 'std::size_t' (aka 'unsigned long') [readability-implicit-bool-conversion]
bool is_prev = hdr->back ? hdr->back->size & 1 : false;
^~~~~
0u
../kernel/src/arch/x86/mm/malloc.cpp:171:9: warning: variable 'is_next' of type 'bool' can be declared 'const' [misc-const-correctness]
bool is_next = hdr != last ? next_of(hdr)->size & 1 : false;
^
const
../kernel/src/arch/x86/mm/malloc.cpp:171:24: warning: implicit conversion 'std::size_t' (aka 'unsigned long') -> bool [readability-implicit-bool-conversion]
bool is_next = hdr != last ? next_of(hdr)->size & 1 : false;
^
!= 0u
../kernel/src/arch/x86/mm/malloc.cpp:171:63: warning: implicit conversion bool -> 'std::size_t' (aka 'unsigned long') [readability-implicit-bool-conversion]
bool is_next = hdr != last ? next_of(hdr)->size & 1 : false;
^~~~~
0u
../kernel/src/arch/x86/cpuid/cpuid.cpp:13:23: warning: variable 'cpuid_max' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
std::uint32_t cpuid_max;
^
../kernel/src/arch/x86/cpuid/cpuid.cpp:14:74: warning: variable 'features' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
std::array<std::uint32_t, config::get_val<"cpuid-feature-size">> features;
^
../kernel/src/arch/x86/cpuid/cpuid.cpp:15:35: warning: 6 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
std::array<std::uint32_t, 6> vendor_buf;
^
../kernel/src/arch/x86/cpuid/cpuid.cpp:15:38: warning: variable 'vendor_buf' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
std::array<std::uint32_t, 6> vendor_buf;
^
../kernel/src/arch/x86/cpuid/cpuid.cpp:16:35: warning: 13 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
std::array<std::uint32_t, 13> brand_buf;
^
../kernel/src/arch/x86/cpuid/cpuid.cpp:16:39: warning: variable 'brand_buf' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
std::array<std::uint32_t, 13> brand_buf;
^
../kernel/src/arch/x86/cpuid/cpuid.cpp:28:80: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
cpuid(CPUID_PROCESSOR_BRAND_STRING_START + i, ptr_start, ptr_start + 1, ptr_start + 2, ptr_start + 3);
^
../kernel/src/arch/x86/cpuid/cpuid.cpp:28:95: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
cpuid(CPUID_PROCESSOR_BRAND_STRING_START + i, ptr_start, ptr_start + 1, ptr_start + 2, ptr_start + 3);
^
../kernel/src/arch/x86/cpuid/cpuid.cpp:28:110: warning: do not use pointer arithmetic [cppcoreguidelines-pro-bounds-pointer-arithmetic]
cpuid(CPUID_PROCESSOR_BRAND_STRING_START + i, ptr_start, ptr_start + 1, ptr_start + 2, ptr_start + 3);
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/vfs/vfs.h:29:7: warning: constructor does not initialize these bases: simple_refcountable [cppcoreguidelines-pro-type-member-init]
class vfs_operations : public std::simple_refcountable<std::uint32_t>
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/vfs/vfs.h:50:19: warning: private field 'flags' is not used [clang-diagnostic-unused-private-field]
std::uint32_t flags; /* flags */
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/vfs/vfs.h:51:19: warning: private field 'block_size' is not used [clang-diagnostic-unused-private-field]
std::uint32_t block_size; /* native block size */
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/vfs/vfs.h:52:19: warning: private field 'fs_id' is not used [clang-diagnostic-unused-private-field]
std::uint32_t fs_id; /* file system id */
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/io.h:11:18: warning: 2 adjacent parameters of 'outw' of similar type ('std::uint16_t') are easily swapped by mistake [bugprone-easily-swappable-parameters]
inline void outw(std::uint16_t port, std::uint16_t val) { asm volatile("outw %0, %1" : : "a"(val), "Nd"(port)); }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/io.h:11:32: note: the first parameter in the range is 'port'
inline void outw(std::uint16_t port, std::uint16_t val) { asm volatile("outw %0, %1" : : "a"(val), "Nd"(port)); }
^~~~
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/io.h:11:52: note: the last parameter in the range is 'val'
inline void outw(std::uint16_t port, std::uint16_t val) { asm volatile("outw %0, %1" : : "a"(val), "Nd"(port)); }
^~~
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/io.h:23:5: warning: variable 'ret' of type 'std::uint8_t' (aka 'unsigned char') can be declared 'const' [misc-const-correctness]
std::uint8_t ret = 0;
^
const
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/io.h:33:5: warning: variable 'ret' of type 'std::uint16_t' (aka 'unsigned short') can be declared 'const' [misc-const-correctness]
std::uint16_t ret = 0;
^
const
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/io.h:43:5: warning: variable 'ret' of type 'std::uint32_t' (aka 'unsigned int') can be declared 'const' [misc-const-correctness]
std::uint32_t ret = 0;
^
const
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/cpu.h:12:39: warning: 4 adjacent parameters of 'cpuid' of similar type ('std::uint32_t *') are easily swapped by mistake [bugprone-easily-swappable-parameters]
inline void cpuid(std::uint32_t code, std::uint32_t* a, std::uint32_t* b, std::uint32_t* c, std::uint32_t* d)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/cpu.h:12:54: note: the first parameter in the range is 'a'
inline void cpuid(std::uint32_t code, std::uint32_t* a, std::uint32_t* b, std::uint32_t* c, std::uint32_t* d)
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/cpu.h:12:108: note: the last parameter in the range is 'd'
inline void cpuid(std::uint32_t code, std::uint32_t* a, std::uint32_t* b, std::uint32_t* c, std::uint32_t* d)
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/cpu.h:12:54: warning: parameter name 'a' is too short, expected at least 3 characters [readability-identifier-length]
inline void cpuid(std::uint32_t code, std::uint32_t* a, std::uint32_t* b, std::uint32_t* c, std::uint32_t* d)
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/cpu.h:12:54: warning: pointer parameter 'a' can be pointer to const [readability-non-const-parameter]
inline void cpuid(std::uint32_t code, std::uint32_t* a, std::uint32_t* b, std::uint32_t* c, std::uint32_t* d)
^
const
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/cpu.h:12:72: warning: parameter name 'b' is too short, expected at least 3 characters [readability-identifier-length]
inline void cpuid(std::uint32_t code, std::uint32_t* a, std::uint32_t* b, std::uint32_t* c, std::uint32_t* d)
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/cpu.h:12:72: warning: pointer parameter 'b' can be pointer to const [readability-non-const-parameter]
inline void cpuid(std::uint32_t code, std::uint32_t* a, std::uint32_t* b, std::uint32_t* c, std::uint32_t* d)
^
const
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/cpu.h:12:90: warning: parameter name 'c' is too short, expected at least 3 characters [readability-identifier-length]
inline void cpuid(std::uint32_t code, std::uint32_t* a, std::uint32_t* b, std::uint32_t* c, std::uint32_t* d)
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/cpu.h:12:90: warning: pointer parameter 'c' can be pointer to const [readability-non-const-parameter]
inline void cpuid(std::uint32_t code, std::uint32_t* a, std::uint32_t* b, std::uint32_t* c, std::uint32_t* d)
^
const
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/cpu.h:12:108: warning: parameter name 'd' is too short, expected at least 3 characters [readability-identifier-length]
inline void cpuid(std::uint32_t code, std::uint32_t* a, std::uint32_t* b, std::uint32_t* c, std::uint32_t* d)
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/cpu.h:12:108: warning: pointer parameter 'd' can be pointer to const [readability-non-const-parameter]
inline void cpuid(std::uint32_t code, std::uint32_t* a, std::uint32_t* b, std::uint32_t* c, std::uint32_t* d)
^
const
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/cpu.h:45:46: warning: 3 adjacent parameters of 'cpuid_ext' of similar type ('std::uint32_t *') are easily swapped by mistake [bugprone-easily-swappable-parameters]
inline auto cpuid_ext(std::uint32_t feature, std::uint32_t* b, std::uint32_t* c, std::uint32_t* d) -> std::uint32_t
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/cpu.h:45:61: note: the first parameter in the range is 'b'
inline auto cpuid_ext(std::uint32_t feature, std::uint32_t* b, std::uint32_t* c, std::uint32_t* d) -> std::uint32_t
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/cpu.h:45:97: note: the last parameter in the range is 'd'
inline auto cpuid_ext(std::uint32_t feature, std::uint32_t* b, std::uint32_t* c, std::uint32_t* d) -> std::uint32_t
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/cpu.h:45:61: warning: parameter name 'b' is too short, expected at least 3 characters [readability-identifier-length]
inline auto cpuid_ext(std::uint32_t feature, std::uint32_t* b, std::uint32_t* c, std::uint32_t* d) -> std::uint32_t
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/cpu.h:45:61: warning: pointer parameter 'b' can be pointer to const [readability-non-const-parameter]
inline auto cpuid_ext(std::uint32_t feature, std::uint32_t* b, std::uint32_t* c, std::uint32_t* d) -> std::uint32_t
^
const
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/cpu.h:45:79: warning: parameter name 'c' is too short, expected at least 3 characters [readability-identifier-length]
inline auto cpuid_ext(std::uint32_t feature, std::uint32_t* b, std::uint32_t* c, std::uint32_t* d) -> std::uint32_t
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/cpu.h:45:79: warning: pointer parameter 'c' can be pointer to const [readability-non-const-parameter]
inline auto cpuid_ext(std::uint32_t feature, std::uint32_t* b, std::uint32_t* c, std::uint32_t* d) -> std::uint32_t
^
const
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/cpu.h:45:97: warning: parameter name 'd' is too short, expected at least 3 characters [readability-identifier-length]
inline auto cpuid_ext(std::uint32_t feature, std::uint32_t* b, std::uint32_t* c, std::uint32_t* d) -> std::uint32_t
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/cpu.h:45:97: warning: pointer parameter 'd' can be pointer to const [readability-non-const-parameter]
inline auto cpuid_ext(std::uint32_t feature, std::uint32_t* b, std::uint32_t* c, std::uint32_t* d) -> std::uint32_t
^
const
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/cpu.h:47:5: warning: variable 'max' of type 'std::uint32_t' (aka 'unsigned int') can be declared 'const' [misc-const-correctness]
std::uint32_t max = 0;
^
const
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/cpu.h:48:74: warning: 7 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
asm volatile("cpuid" : "=a"(max), "=b"(*b), "=c"(*c), "=d"(*d) : "a"(7), "c"(feature));
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/cpu.h:52:9: warning: function-like macro 'READ_CR' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage]
#define READ_CR(CR) \
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/cpu.h:59:9: warning: function-like macro 'WRITE_CR' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage]
#define WRITE_CR(CR) \
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/cpu.h:129:19: warning: 2 adjacent parameters of 'wrmsr' of similar type ('std::uint64_t') are easily swapped by mistake [bugprone-easily-swappable-parameters]
inline void wrmsr(std::uint64_t msr, std::uint64_t value)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/cpu.h:129:33: note: the first parameter in the range is 'msr'
inline void wrmsr(std::uint64_t msr, std::uint64_t value)
^~~
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/cpu.h:129:52: note: the last parameter in the range is 'value'
inline void wrmsr(std::uint64_t msr, std::uint64_t value)
^~~~~
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/cpu.h:131:5: warning: variable 'low' of type 'std::uint32_t' (aka 'unsigned int') can be declared 'const' [misc-const-correctness]
std::uint32_t low = value & 0xFFFFFFFF;
^
const
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/cpu.h:131:33: warning: 0xFFFFFFFF is a magic number; consider replacing it with a named constant [readability-magic-numbers]
std::uint32_t low = value & 0xFFFFFFFF;
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/cpu.h:132:5: warning: variable 'high' of type 'std::uint32_t' (aka 'unsigned int') can be declared 'const' [misc-const-correctness]
std::uint32_t high = value >> 32;
^
const
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/cpu.h:140:38: warning: 2 adjacent parameters of 'wrmsr' of similar type ('std::uint32_t') are easily swapped by mistake [bugprone-easily-swappable-parameters]
inline void wrmsr(std::uint64_t msr, std::uint32_t a, std::uint32_t d) { asm volatile("wrmsr" : : "c"(msr), "a"(a), "d"(d)); }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/cpu.h:140:52: note: the first parameter in the range is 'a'
inline void wrmsr(std::uint64_t msr, std::uint32_t a, std::uint32_t d) { asm volatile("wrmsr" : : "c"(msr), "a"(a), "d"(d)); }
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/cpu.h:140:69: note: the last parameter in the range is 'd'
inline void wrmsr(std::uint64_t msr, std::uint32_t a, std::uint32_t d) { asm volatile("wrmsr" : : "c"(msr), "a"(a), "d"(d)); }
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/cpu.h:140:52: warning: parameter name 'a' is too short, expected at least 3 characters [readability-identifier-length]
inline void wrmsr(std::uint64_t msr, std::uint32_t a, std::uint32_t d) { asm volatile("wrmsr" : : "c"(msr), "a"(a), "d"(d)); }
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/cpu.h:140:69: warning: parameter name 'd' is too short, expected at least 3 characters [readability-identifier-length]
inline void wrmsr(std::uint64_t msr, std::uint32_t a, std::uint32_t d) { asm volatile("wrmsr" : : "c"(msr), "a"(a), "d"(d)); }
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/cpu.h:147:5: warning: variable 'low' of type 'std::uint32_t' (aka 'unsigned int') can be declared 'const' [misc-const-correctness]
std::uint32_t low = 0;
^
const
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/cpu.h:148:5: warning: variable 'high' of type 'std::uint32_t' (aka 'unsigned int') can be declared 'const' [misc-const-correctness]
std::uint32_t high = 0;
^
const
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/asm/cpu.h:165:9: warning: function-like macro 'intr' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage]
#define intr(int_no) asm volatile("int $" #int_no);
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/pci/pci.h:10:11: warning: class 'pci_device_ident' defines a copy constructor but does not define a destructor, a copy assignment operator, a move constructor or a move assignment operator [cppcoreguidelines-special-member-functions]
class pci_device_ident
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/pci/pci.h:16:75: warning: 11 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
return ((std::uint32_t)_bus << 16) | ((std::uint32_t)_slot << 11) | ((std::uint32_t)func << 8) | ((std::uint32_t)offset & 0xfc) |
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/pci/pci.h:16:135: warning: 0xfc is a magic number; consider replacing it with a named constant [readability-magic-numbers]
return ((std::uint32_t)_bus << 16) | ((std::uint32_t)_slot << 11) | ((std::uint32_t)func << 8) | ((std::uint32_t)offset & 0xfc) |
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/pci/pci.h:21:36: warning: 2 adjacent parameters of 'pci_device_ident' of similar type ('std::uint8_t') are easily swapped by mistake [bugprone-easily-swappable-parameters]
constexpr pci_device_ident(std::uint8_t bus, std::uint8_t slot) : _bus(bus), _slot(slot) {}
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/pci/pci.h:21:49: note: the first parameter in the range is 'bus'
constexpr pci_device_ident(std::uint8_t bus, std::uint8_t slot) : _bus(bus), _slot(slot) {}
^~~
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/pci/pci.h:21:67: note: the last parameter in the range is 'slot'
constexpr pci_device_ident(std::uint8_t bus, std::uint8_t slot) : _bus(bus), _slot(slot) {}
^~~~
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/pci/pci.h:42:120: warning: 24 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
[[nodiscard]] inline auto class_code(std::uint8_t func) const -> std::uint8_t { return read_config(func, 8) >> 24; }
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/pci/pci.h:46:108: warning: 12 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
[[nodiscard]] inline auto bist(std::uint8_t func) const -> std::uint8_t { return read_config(func, 12) >> 24; }
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/pci/pci.h:46:115: warning: 24 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
[[nodiscard]] inline auto bist(std::uint8_t func) const -> std::uint8_t { return read_config(func, 12) >> 24; }
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/pci/pci.h:47:115: warning: 12 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
[[nodiscard]] inline auto header_type(std::uint8_t func) const -> std::uint8_t { return read_config(func, 12) >> 16; }
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/pci/pci.h:48:117: warning: 12 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
[[nodiscard]] inline auto latency_timer(std::uint8_t func) const -> std::uint8_t { return read_config(func, 12) >> 8; }
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/pci/pci.h:49:119: warning: 12 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
[[nodiscard]] inline auto cache_line_size(std::uint8_t func) const -> std::uint8_t { return read_config(func, 12); }
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/apic/apic_flag_builder.h:15:53: warning: 17 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
return (static_cast<std::uint32_t>(mode) << 17) | (static_cast<std::uint32_t>(is_masked) << 16) |
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/apic/apic_flag_builder.h:16:64: warning: 12 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
(static_cast<std::uint32_t>(is_send_pending) << 12) | (vector);
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/apic/apic_flag_builder.h:30:112: warning: 12 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
return (static_cast<std::uint32_t>(is_masked) << 16) | (static_cast<std::uint32_t>(is_send_pending) << 12) | vector;
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/apic/apic_flag_builder.h:51:116: warning: 15 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
return build_lvt_cmci(is_masked, is_send_pending, mode, vector) | (static_cast<std::uint32_t>(is_level) << 15) |
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/apic/apic_flag_builder.h:52:59: warning: 14 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
(static_cast<std::uint32_t>(remote_irr) << 14) | (static_cast<std::uint32_t>(int_in_pin_polarity) << 13);
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/apic/apic_flag_builder.h:52:117: warning: 13 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
(static_cast<std::uint32_t>(remote_irr) << 14) | (static_cast<std::uint32_t>(int_in_pin_polarity) << 13);
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/apic/apic.h:49:34: warning: 6 is a magic number; consider replacing it with a named constant [readability-magic-numbers]
register_reserved r2[6];
^
/home/flowey/dev/kernel-dev/kernel/kernel/include/arch/x86/apic/apic.h:101:35: warning: method 'get_apic_base' can be made static [readability-convert-member-functions-to-static]
[[nodiscard]] inline auto get_apic_base() -> std::uintptr_t { return 0x0ffffff000 & rdmsr(msr::IA32_APIC_BASE); }
^
static