Skip to content

S33.04: Prefix the unprefixed — RecordStore, BlockSequence, ExternC.h and its macros #673

Description

@DavidCozens

Parent epic: #669

Purpose

Path B puts Core/Source on the integrator's include path (the adapters include
SolidSyslogPoolAllocator.h from it), and IDE projects and many Makefiles flatten object
files into one directory. Everything is prefixed SolidSyslog* except:

Core/Interface/ExternC.h            <- a public header, and a very common name
Core/Source/RecordStore.c           Core/Source/RecordStorePrivate.h
Core/Source/RecordStoreStatic.c
Core/Source/BlockSequence.c         Core/Source/BlockSequencePrivate.h
Core/Source/BlockSequenceStatic.c

CMake consumers never notice, because targets scope include directories and object
directories. Path B integrators get ExternC.h in scope and RecordStore.o in a shared
object directory.

ExternC.h is worse than its filename

It also defines unprefixed macrosEXTERN_C_BEGIN, EXTERN_C_END, and the guard
EXTERNC_H — and it is included by 228 files, i.e. every public header. Include-dir
scoping does not help with macros: they land in every translation unit that includes any
SolidSyslog header, on both paths. The rename must cover the macros, not just the file.

Timing

Nothing is tagged and PR #101 (release-please 0.1.0) is still open, so there are currently
zero consumers and this is free. Note the project's API-freeze gate is 1.0.0, not 0.1.0 —
0.x still permits breaks — so this is not racing a release, but churn for beta users is
real and the window will never be cheaper than now.

Open — settle when the story is picked up

  • Target names. SolidSyslogRecordStore* / SolidSyslogBlockSequence* is the obvious
    reading of docs/NAMING.md, and SolidSyslogExternC.h with
    SOLIDSYSLOG_EXTERN_C_BEGIN / _END for the macros — to be confirmed against NAMING.md
    rather than assumed.
  • Whether the TU-local statics inside those files (currently RecordStore_ /
    BlockSequence_ prefixed, which is Tier 2 conformant as-is) move too, or stay.
  • Whether Private.h / Static.c siblings follow mechanically or need thought.

Known hazards

Per prior sweep experience: macro-token statics, partial conformance leaving a mixed state,
and NOLINTNEXTLINE comments breaking when clang-format re-wraps. scripts/misra_renumber.py
runs last, after the clang-format reflow, and over Core and Platform — not Core only.

Consumer impact

Checked against solid-syslog-example at cc775f5: RecordStore / BlockSequence are
Core/Source internals behind target_sources, and ExternC.h / EXTERN_C_* appear
nowhere under its app/ — grepped, zero hits. The rename is invisible to that consumer.
Its measurements are section sizes and heap only, so renamed symbols (which live in
non-loaded .symtab / .strtab) cannot move a figure.

Acceptance

  • No file under Core/ and no macro reaching an integrator's namespace is unprefixed.
  • The committed manifest regenerates with the new names.
  • Full CI green, including the FreeRTOS host lane (the debug preset silently skips the
    FreeRtos trees when FREERTOS_KERNEL_PATH is unset, so renames need verifying in the
    cpputest-freertos image).

Metadata

Metadata

Assignees

No one assigned

    Labels

    storyStory issue

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions