Skip to content

arch/arm: Fix the compilation error#18734

Merged
simbit18 merged 1 commit intoapache:masterfrom
xiaoqizhan:local
Apr 14, 2026
Merged

arch/arm: Fix the compilation error#18734
simbit18 merged 1 commit intoapache:masterfrom
xiaoqizhan:local

Conversation

@xiaoqizhan
Copy link
Copy Markdown
Contributor

When the macro SDADC_HAVE_TIMER is enabled, a compilation error will occur due to the missing semicolon after the variable.

Note: Please adhere to Contributing Guidelines.

Summary

This PR fixes a compilation error caused by a missing semicolon at the end of the jextsel variable declaration. The error is triggered when the macro SDADC_HAVE_TIMER is enabled: the jextsel variable (used to store the JEXTSEL value for the SDADC block) lacks a trailing semicolon, which violates C syntax rules and blocks the build process. This change only adds the missing semicolon to the jextsel variable definition under the SDADC_HAVE_TIMER macro guard, with no other logic modifications—ensuring compliance with C syntax and resolving the compilation failure.

Impact

Build process: Resolves the compilation error that occurs when SDADC_HAVE_TIMER is enabled; no impact on build logic or output for scenarios where this macro is disabled.

Users/Hardware: No functional changes to SDADC or timer-related features; the behavior of the SDADC block and associated timer (base address, PCLK frequency, conversion frequency) remains unchanged. Only fixes a syntax error that prevented successful compilation for users enabling the SDADC_HAVE_TIMER macro.

Compatibility/Security: Fully backward-compatible—no breaking changes to existing code, APIs, or hardware interactions. No security implications as this is a pure syntax correction.

Documentation: No changes to documentation are required, as this is a bug fix for a syntax error rather than a feature modification.

Testing

  1. Host Machine Information
    Host OS: Ubuntu 22.04 LTS (x86_64)
    Toolchain: GNU Arm Embedded Toolchain 10.3-2021.10 (arm-none-eabi-gcc)
    Build system: GNU Make 4.3
  2. Tested Board & Configuration
    Target board: STM32H743I-EVAL (SDADC peripheral and timer functionality are supported)
    Configuration: Enabled the SDADC_HAVE_TIMER macro via menuconfig (Configuration → Drivers → Analog → SDADC → Enable timer support for SDADC)
  3. Test Logs (Key Snippets)
    Pre-fix compilation error log:
    plaintext
    CC: drivers/analog/stm32_sdadc.c
    ../drivers/analog/stm32_sdadc.c:456:16: error: expected ';' before 'uint32_t'
    uint32_t pclck; /* The PCLK frequency that drives this timer /
    ^~~~~~
    ;
    ../drivers/analog/stm32_sdadc.c:455:16: note: in this expansion of SDADC_HAVE_TIMER
    uint32_t jextsel /
    JEXTSEL value used by this SDADC block */
    ^~~~~~~
    make: *** [Makefile:1247: drivers/analog/stm32_sdadc.o] Error 1
    PRs without testing information will not be accepted. We will
    request test logs.

    Post-fix build success log:
    plaintext
    CC: drivers/analog/stm32_sdadc.c
    AR: drivers/analog/libanalog.a
    LD: nuttx.elf
    OBJCOPY: nuttx.bin
    OBJDUMP: nuttx.dis
  4. Additional Verification
    Checked all other code paths under SDADC_HAVE_TIMER (timer base address, PCLK frequency, conversion frequency variables) to confirm no other syntax issues.
    Tested builds with SDADC_HAVE_TIMER disabled: no compilation warnings/errors, and existing SDADC functionality remains intact.

When the macro SDADC_HAVE_TIMER is enabled, a compilation
error will occur due to the missing semicolon after the variable.

Signed-off-by: zhanxiaoqi <zhanxiaoqi@bytedance.com>
@github-actions github-actions Bot added Arch: arm Issues related to ARM (32-bit) architecture Size: XS The size of the change in this PR is very small labels Apr 14, 2026
@simbit18 simbit18 merged commit 8c82d20 into apache:master Apr 14, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: arm Issues related to ARM (32-bit) architecture Size: XS The size of the change in this PR is very small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants