Commit 0b90fd5
samples, tests, boards: Switch main return type from void to int
As both C and C++ standards require applications running under an OS to
return 'int', adapt that for Zephyr to align with those standard. This also
eliminates errors when building with clang when not using -ffreestanding,
and reduces the need for compiler flags to silence warnings for both clang
and gcc.
Most of these changes were automated using coccinelle with the following
script:
@@
@@
- void
+ int
main(...) {
...
- return;
+ return 0;
...
}
Approximately 40 files had to be edited by hand as coccinelle was unable to
fix them.
Signed-off-by: Keith Packard <keithp@keithp.com>1 parent fc076f5 commit 0b90fd5
File tree
447 files changed
+1617
-1231
lines changed- boards/arm/mps2_an521/empty_cpu0/src
- kernel
- samples
- application_development
- code_relocation_nocopy/src
- external_lib/src
- out_of_tree_board/src
- out_of_tree_driver/src
- sysbuild/with_mcuboot/src
- arch
- mpu/mpu_test/src
- smp
- pi/src
- pktqueue/src
- basic
- blinky_pwm/src
- blinky/src
- button/src
- custom_dts_binding/src
- fade_led/src
- hash_map/src
- minimal/src
- rgb_led/src
- servo_motor/src
- sys_heap/src
- bluetooth
- beacon/src
- broadcast_audio_sink/src
- broadcast_audio_source/src
- broadcaster_multiple/src
- broadcaster/src
- central_gatt_write/src
- central_hr/src
- central_ht/src
- central_iso/src
- central_multilink/src
- central_otc/src
- central_past/src
- central/src
- direct_adv/src
- direction_finding_central/src
- direction_finding_connectionless_rx/src
- direction_finding_connectionless_tx/src
- direction_finding_peripheral/src
- eddystone/src
- handsfree/src
- hap_ha/src
- hci_pwr_ctrl/src
- hci_rpmsg/src
- hci_spi/src
- hci_uart/src
- hci_usb_h4/src
- hci_usb/src
- ibeacon/src
- ipsp/src
- iso_broadcast_benchmark/src
- iso_broadcast/src
- iso_connected_benchmark/src
- iso_receive/src
- mesh_demo/src
- mesh_provisioner/src
- mesh/src
- mtu_update
- central/src
- peripheral/src
- observer/src
- periodic_adv/src
- periodic_sync/src
- peripheral_accept_list/src
- peripheral_csc/src
- peripheral_dis/src
- peripheral_esp/src
- peripheral_gatt_write/src
- peripheral_hids/src
- peripheral_hr/src
- peripheral_ht/src
- peripheral_identity/src
- peripheral_iso/src
- peripheral_ots/src
- peripheral_past/src
- peripheral_sc_only/src
- peripheral/src
- scan_adv/src
- st_ble_sensor/src
- unicast_audio_client/src
- unicast_audio_server/src
- boards
- 96b_argonkey
- microphone/src
- sensors/src
- arc_secure_services/src
- bbc_microbit
- display/src
- line_follower_robot/src
- pong/src
- sound/src
- esp32
- deep_sleep/src
- ethernet/src
- flash_encryption/src
- light_sleep/src
- spiram_test/src
- google_kukui/src
- intel_adsp/code_relocation/src
- litex/i2s/src
- mec15xxevb_assy6853/power_management/src
- mimxrt1060_evk/system_off/src
- mimxrt595_evk_cm33/system_off/src
- nrf
- battery/src
- clock_skew/src
- dynamic_pinctrl/src
- mesh
- onoff-app/src
- onoff_level_lighting_vnd_app/src
- nrf53_sync_rtc
- net/src
- src
- nrf_led_matrix/src
- nrfx_prs/src
- nrfx/src
- system_off/src
- nxp_s32/netc/src
- qomu/src
- reel_board/mesh_badge/src
- sensortile_box/src
- stm32
- backup_sram/src
- ccm/src
- h7_dual_core/src
- power_mgmt
- blinky/src
- serial_wakeup/src
- stm32wb_ble/src
- ti/cc13x2_cc26x2/system_off/src
- up_squared/gpio_counter/src
- compression/lz4/src
- drivers
- adc/src
- audio/dmic/src
- can
- babbling/src
- counter/src
- clock_control_litex/src
- clock_control_xec/src
- counter
- alarm/src
- maxim_ds3231/src
- crypto/src
- dac/src
- display/src
- eeprom/src
- espi/src
- flash_shell/src
- fpga/fpga_controller/src
- ht16k33/src
- i2s/echo/src
- ipm
- ipm_esp32
- ipm_esp32_net/src
- src
- ipm_imx/src
- ipm_mcux
- remote/src
- src
- ipm_mhu_dual_core/src
- jesd216/src
- kscan_touch/src
- kscan/src
- lcd_cyclonev_socdk/src
- lcd_hd44780/src
- led_apa102c_bitbang/src
- led_apa102/src
- led_lp3943/src
- led_lp503x/src
- led_lp5562/src
- led_lpd8806/src
- led_pca9633/src
- led_pwm/src
- led_sx1509b_intensity/src
- led_ws2812/src
- led_xec/src
- lora
- receive/src
- send/src
- mbox
- remote/src
- src
- memc/src
- misc
- ft800/src
- grove_display/src
- peci/src
- ps2/src
- soc_flash_nrf/src
- spi_bitbang/src
- spi_flash_at45/src
- spi_flash/src
- spi_fujitsu_fram/src
- uart
- echo_bot/src
- stm32/single_wire/src
- w1/scanner/src
- watchdog/src
- hello_world/src
- kernel
- condition_variables
- condvar/src
- simple/src
- metairq_dispatch/src
- modules
- canopennode/src
- nanopb/src
- net
- capture/src
- cloud
- google_iot_mqtt/src
- mqtt_azure/src
- tagoio_http_post/src
- dhcpv4_client/src
- dns_resolve/src
- dsa/src
- eth_native_posix/src
- gptp/src
- ipv4_autoconf/src
- lldp/src
- lwm2m_client/src
- mdns_responder/src
- mqtt_publisher/src
- mqtt_sn_publisher/src
- openthread/coprocessor/src
- promiscuous_mode/src
- sockets
- big_http_download/src
- can/src
- coap_client/src
- coap_server/src
- dumb_http_server_mt/src
- dumb_http_server/src
- echo_async_select/src
- echo_async/src
- echo_client/src
- echo_server/src
- echo/src
- http_client/src
- http_get/src
- net_mgmt/src
- packet/src
- sntp_client/src
- socketpair/src
- tcp/src
- txtime/src
- websocket_client/src
- stats/src
- syslog_net/src
- telnet/src
- virtual/src
- vlan/src
- wifi/src
- wpan_serial/src
- wpanusb/src
- zperf/src
- philosophers/src
- sensor
- accel_polling/src
- adc_cmp_npcx/src
- adt7420/src
- amg88xx/src
- ams_iAQcore/src
- apds9960/src
- bme280/src
- bme680/src
- bmg160/src
- bmi270/src
- bq274xx/src
- ccs811/src
- dht/src
- die_temp_polling/src
- dps310/src
- ds18b20/src
- ens210/src
- esp32_temp_sensor/src
- fdc2x1x/src
- fxas21002/src
- fxos8700-hid/src
- fxos8700/src
- grove_light/src
- grove_temperature/src
- grow_r502a/src
- hts221/src
- i3g4250d/src
- icm42605/src
- ina219/src
- isl29035/src
- lis2dh/src
- lps22hb/src
- lps22hh/src
- lsm303dlhc/src
- lsm6dsl/src
- lsm6dso/src
- magn_polling/src
- max17262/src
- max30101/src
- max44009/src
- max6675/src
- mcp9808/src
- mcux_acmp/src
- mhz19b/src
- mpr/src
- mpu6050/src
- ms5837/src
- qdec/src
- sensor_shell/src
- sgp40_sht4x/src
- sht3xd/src
- sm351lt/src
- stm32_vbat_sensor/src
- sx9500/src
- th02/src
- thermometer/src
- ti_hdc/src
- tmp108/src
- tmp112/src
- tmp116/src
- vcnl4040/src
- vl53l0x/src
- wsen_hids/src
- wsen_itds/src
- shields
- lmp90100_evb/rtd/src
- npm6001_ek/src
- x_nucleo_53l0a1/src
- x_nucleo_iks01a1/src
- x_nucleo_iks01a2
- sensorhub/src
- standard/src
- x_nucleo_iks01a3
- sensorhub/src
- standard/src
- x_nucleo_iks02a1
- microphone/src
- sensorhub/src
- standard/src
- subsys
- canbus/isotp/src
- console
- echo/src
- getchar/src
- getline/src
- debug
- debugmon/src
- fuzz/src
- gdbstub/src
- display
- cfb_custom_font/src
- cfb/src
- lvgl/src
- edac/src
- fs
- fat_fs/src
- format/src
- littlefs/src
- input/input_dump/src
- ipc
- openamp_rsc_table/src
- openamp
- remote/src
- src
- rpmsg_service
- remote/src
- src
- logging
- dictionary/src
- multidomain
- remote/src
- src
- lorawan/class_a/src
- mgmt
- hawkbit/src
- mcumgr/smp_svr/src
- osdp
- control_panel/src
- peripheral_device/src
- updatehub/src
- modbus
- rtu_client/src
- rtu_server/src
- tcp_gateway/src
- tcp_server/src
- nvs/src
- pm
- device_pm/src
- latency/src
- portability
- cmsis_rtos_v1
- philosophers/src
- timer_synchronization/src
- cmsis_rtos_v2
- philosophers/src
- timer_synchronization/src
- rtio/sensor_batch_processing/src
- settings/src
- shell
- devmem_load/src
- fs/src
- shell_module/src
- task_wdt/src
- usb_c/sink/src
- usb
- audio
- headphones_microphone/src
- headset/src
- cdc_acm_composite/src
- cdc_acm/src
- console/src
- dfu/src
- hid-cdc/src
- hid-mouse/src
- hid/src
- mass/src
- shell/src
- testusb/src
- webusb/src
- video
- capture/src
- tcpserversink/src
- zbus
- dyn_channel/src
- hello_world/src
- remote_mock/src
- runtime_obs_registration/src
- work_queue/src
- synchronization/src
- tfm_integration
- psa_protected_storage/src
- tfm_ipc/src
- tfm_psa_test/src
- tfm_regression_test/src
- tfm_secure_partition/src
- userspace
- hello_world_user/src
- prod_consumer/src
- syscall_perf/src
- subsys/testsuite/ztest/src
- tests
- arch/x86/info/src
- benchmarks
- app_kernel/src
- footprints/src
- latency_measure/src
- mbedtls/src
- sched_userspace/src
- sched/src
- sys_kernel/src
- bluetooth
- mesh_shell/src
- mesh/basic/src
- shell/src
- tester/src
- boards/native_posix/native_tasks/src
- boot
- test_mcuboot
- src
- swapped_app/src
- uefi/src
- bsim/bluetooth
- audio/src
- host
- adv
- chain/src
- periodic/src
- resume/src
- att
- eatt_notif/src
- eatt/src
- mtu_update/src
- gatt
- caching/src
- general/src
- notify_multiple/src
- notify/src
- write/src
- l2cap
- general/src
- stress/src
- userdata/src
- misc/disable/src
- security
- bond_overwrite_allowed/src
- bond_overwrite_denied/src
- ll
- advx/src
- conn/src
- edtt
- gatt_test_app/src
- hci_test_app/src
- iso/src
- multiple_id/src
- mesh/src
- drivers
- build_all
- adc/src
- counter/src
- dac/src
- eeprom/src
- ethernet/src
- fpga/src
- gpio/src
- i3c/src
- ieee802154/src
- led_strip/src
- led/src
- modem/src
- pwm/src
- sensor/src
- video/src
- console/src
- ipm/src
- kernel/fatal/message_capture/src
- lib/cbprintf_fp/src
- misc/print_format/src
- subsys/debug/coredump/src
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
447 files changed
+1617
-1231
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
332 | 332 | | |
333 | 333 | | |
334 | 334 | | |
335 | | - | |
336 | 335 | | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | 336 | | |
341 | 337 | | |
342 | 338 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
57 | 58 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
| 142 | + | |
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
| 148 | + | |
149 | 149 | | |
150 | 150 | | |
| 151 | + | |
151 | 152 | | |
152 | 153 | | |
153 | 154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| 115 | + | |
115 | 116 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
| 204 | + | |
204 | 205 | | |
0 commit comments