Skip to content

Conversation

@AarC10
Copy link
Member

@AarC10 AarC10 commented Jan 27, 2026

Description

Replace header guards with the more modern pragma once which we already use in our other codebases.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Local compiles and CI

Checklist:

  • New functionality is documented in the necessary spots (i.e new functions documented in the header)
  • Unit tests cover any new functionality or edge cases that the PR was meant to resolve (if applicable)
  • The CI checks are passing
  • I reviewed my own code in the GitHub diff and am sure that each change is intentional
  • I feel comfortable about this code flying in a rocket

@AarC10 AarC10 requested a review from a team as a code owner January 27, 2026 16:00
@AarC10 AarC10 requested a review from Copilot January 27, 2026 16:00
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to modernize the codebase by replacing traditional header guards (#ifndef/#define/#endif) with #pragma once directives across all header files in the repository.

Changes:

  • Replace header guards with #pragma once in all header files across launch_core_classic, f_core, sample applications, payload applications, ground applications, and backplane modules
  • Remove closing #endif directives that were part of the old header guard system
  • Standardize header protection mechanism across the entire codebase

Reviewed changes

Copilot reviewed 104 out of 104 changed files in this pull request and generated 25 comments.

Show a summary per file
File Description
include/launch_core_classic/utils/event_monitor.h Replaced header guard with #pragma once
include/launch_core_classic/types.h Replaced header guard with #pragma once, inadvertently removed FLOAT_ERROR_VALUE macro
include/launch_core_classic/os/time.h Incomplete: removed closing #endif but missing #pragma once addition
include/launch_core_classic/os/fs.h Replaced header guard, inadvertently removed ENOTINIT and L_FS_CREATE_FILE macros
include/launch_core_classic/net/udp.h Incomplete: removed closing #endif but missing #pragma once addition
include/launch_core_classic/net/tftp.h Replaced header guard with #pragma once
include/launch_core_classic/net/sntp.h Replaced header guard, inadvertently removed SNTP_CLIENT_STACK_SIZE macro
include/launch_core_classic/net/net_common.h Incomplete: removed closing #endif but missing #pragma once addition
include/launch_core_classic/net/lora.h Incomplete: removed closing #endif but missing #pragma once addition
include/launch_core_classic/extension_boards.h Incomplete: only removed #define, left orphaned #ifndef
include/launch_core_classic/dev/uart.h Replaced header guard with #pragma once
include/launch_core_classic/dev/sensor.h Incomplete: removed closing #endif but missing #pragma once addition
include/launch_core_classic/dev/gnss.h Incomplete: only removed #define, left orphaned #ifndef
include/launch_core_classic/dev/dev_common.h Incomplete: removed closing #endif but missing #pragma once addition
include/launch_core_classic/dev/adc.h Incomplete: removed closing #endif but missing #pragma once addition
include/launch_core_classic/conversions.h Incomplete: only removed #define, left orphaned #ifndef and closing #endif
include/launch_core_classic/backplane_defs.h Incomplete: only removed #define, left orphaned #ifndef
include/f_core/utils/n_time_utils.h Replaced header guard but has orphaned #endif on line 32
include/f_core/utils/n_gnss_utils.h Replaced header guard with #pragma once
include/f_core/utils/debouncer.hpp Replaced header guard with #pragma once
include/f_core/utils/circular_buffer.hpp Replaced header guard with #pragma once
include/f_core/utils/c_soft_timer.h Replaced header guard with #pragma once
include/f_core/utils/c_observer.h Replaced header guard with #pragma once
include/f_core/utils/c_hashmap.h Replaced header guard with #pragma once
include/f_core/state_machine/c_pad_flight_landing_state_machine.h Replaced header guard with #pragma once
include/f_core/radio/protocols/horus/horus.h Has orphaned #endif directives from incomplete header guard removal
include/f_core/radio/frame_handlers/c_lora_freq_request_tenant.h Replaced header guard with #pragma once
include/f_core/radio/frame_handlers/c_lora_frame_to_udp_handler.h Replaced header guard with #pragma once
include/f_core/radio/frame_handlers/c_frequency_change_handler.h Replaced header guard with #pragma once
include/f_core/radio/c_lora_router.h Replaced header guard with #pragma once
include/f_core/radio/c_lora_link.h Replaced header guard with #pragma once
include/f_core/radio/c_lora_frame_handler.h Replaced header guard with #pragma once
include/f_core/radio/c_lora.h Replaced header guard with #pragma once
include/f_core/radio/application/c_lora_tenant.h Replaced header guard with #pragma once
include/f_core/os/tenants/c_datalogger_tenant.h Replaced header guard with #pragma once
include/f_core/os/n_rtos.h Replaced header guard with #pragma once
include/f_core/os/flight_log.hpp Replaced header guard with #pragma once
include/f_core/os/c_tenant.h Replaced header guard with #pragma once
include/f_core/os/c_task.h Replaced header guard with #pragma once
include/f_core/os/c_runnable_tenant.h Replaced header guard with #pragma once
include/f_core/os/c_latest_mailbox.h Replaced header guard with #pragma once
include/f_core/os/c_file.h Replaced header guard with #pragma once
include/f_core/os/c_datalogger.h Replaced header guard with #pragma once
include/f_core/os/c_callback_tenant.h Replaced header guard with #pragma once
include/f_core/net/transport/c_udp_socket.h Replaced header guard with #pragma once
include/f_core/net/network/c_ipv4.h Replaced header guard with #pragma once
include/f_core/net/device/c_rs485.h Replaced header guard with #pragma once
include/f_core/net/c_transciever.h Replaced header guard with #pragma once
include/f_core/net/application/c_udp_receiver_tenant.h Replaced header guard with #pragma once
include/f_core/net/application/c_udp_broadcast_tenant.h Replaced header guard with #pragma once
include/f_core/net/application/c_udp_alert_tenant.h Replaced header guard with #pragma once
include/f_core/net/application/c_tftp_server_tenant.h Replaced header guard with #pragma once
include/f_core/net/application/c_sntp_server_tenant.h Replaced header guard with #pragma once
include/f_core/n_alerts.h Replaced header guard with #pragma once
include/f_core/messaging/c_msgq_message_port.h Replaced header guard with #pragma once
include/f_core/messaging/c_message_port.h Replaced header guard with #pragma once
include/f_core/messaging/c_latest_message_port.h Replaced header guard with #pragma once
include/f_core/flight/c_phase_controller.h Replaced header guard with #pragma once
include/f_core/device/sensor/n_sensor_calibrators.h Replaced header guard with #pragma once
include/f_core/device/sensor/c_temperature_sensor.h Replaced header guard with #pragma once
include/f_core/device/sensor/c_shunt.h Replaced header guard with #pragma once
include/f_core/device/sensor/c_sensor_device.h Replaced header guard with #pragma once
include/f_core/device/sensor/c_magnetometer.h Replaced header guard with #pragma once
include/f_core/device/sensor/c_gyroscope.h Replaced header guard with #pragma once
include/f_core/device/sensor/c_barometer.h Replaced header guard with #pragma once
include/f_core/device/sensor/c_accelerometer.h Replaced header guard with #pragma once
include/f_core/device/c_rtc.h Replaced header guard with #pragma once
include/f_core/device/c_gpio.h Replaced header guard with #pragma once
include/f_core/c_project_configuration.h Replaced header guard with #pragma once
app/samples/tftp_server/include/message.h Replaced header guard with #pragma once
app/samples/tenants_and_tasks/include/c_print_count.h Incomplete: added #pragma once but did not remove header guard closing #endif
app/samples/tenants_and_tasks/include/c_hello_tenant.h Replaced header guard with #pragma once
app/samples/phase_detection/src/flight.h Replaced header guard with #pragma once
app/samples/message_passing/include/message.h Replaced header guard with #pragma once
app/samples/message_passing/include/c_receiver.h Replaced header guard with #pragma once
app/samples/message_passing/include/c_publisher.h Incomplete: added #pragma once but did not remove header guard closing #endif
app/payload/control_freak/flight-software/src/pump.h Inadvertently removed multiple functional macros
app/payload/control_freak/flight-software/src/gps.h Replaced header guard with #pragma once
app/payload/control_freak/flight-software/src/flight.h Replaced header guard with #pragma once
app/payload/control_freak/flight-software/src/data.h Replaced header guard, inadvertently removed IMU_SAMPLES_PER_PACKET macro
app/payload/control_freak/flight-software/src/common.h Replaced header guard with #pragma once
app/payload/control_freak/flight-software/src/buzzer.h Replaced header guard with #pragma once
app/payload/control_freak/flight-software/src/boost.h Replaced header guard with #pragma once
app/payload/.retired/app_grim_reefer/src/data_storage.h Replaced header guard with #pragma once
app/payload/.retired/app_grim_reefer/src/data_reading.h Replaced header guard with #pragma once
app/payload/.retired/app_grim_reefer/src/config.h Replaced header guard, inadvertently removed BUZZER_USE_LED and SHORT_FLIGHT macros
app/payload/.retired/app_grim_reefer/src/buzzer.h Replaced header guard with #pragma once
app/payload/.retired/app_grim_reefer/src/boost_detect.h Replaced header guard with #pragma once
app/other/.retired/app_potato/include/potato.h Replaced header guard with #pragma once
app/ground/receiver_module/include/c_udp_listener_tenant.h Replaced header guard with #pragma once
app/ground/receiver_module/include/c_receiver_module.h Replaced header guard with #pragma once
app/backplane/sensor_module/include/c_sensor_module.h Replaced header guard with #pragma once
app/backplane/sensor_module/include/c_sensing_tenant.h Replaced header guard with #pragma once, has trailing whitespace
app/backplane/sensor_module/include/c_detection_handler.h Added #pragma once (file previously had no header guard)
app/backplane/radio_module/include/c_udp_listener_tenant.h Replaced header guard with #pragma once
app/backplane/radio_module/include/c_state_machine_updater.h Replaced header guard with #pragma once
app/backplane/radio_module/include/c_remote_gpio_handler.h Replaced header guard with #pragma once
app/backplane/radio_module/include/c_radio_module.h Replaced header guard with #pragma once
app/backplane/radio_module/include/c_gnss_tenant.h Replaced header guard with #pragma once
app/backplane/radio_module/include/c_downlink_scheduler_tenant.h Replaced header guard with #pragma once
app/backplane/power_module/include/c_sensing_tenant.h Replaced header guard with #pragma once
app/backplane/power_module/include/c_power_module.h Replaced header guard with #pragma once
app/backplane/deployment_module/include/c_pyro_control_observer.h Replaced header guard with #pragma once
app/backplane/deployment_module/include/c_deployment_module.h Replaced header guard with #pragma once

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@AarC10 AarC10 merged commit d098965 into main Jan 29, 2026
6 checks passed
@AarC10 AarC10 deleted the bugfix/Aaron/PragmaOnce branch January 29, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants