Skip to content

fix(build): unbreak main — three PageLayout initializers and an msvc raw string - #825

Merged
andiwand merged 1 commit into
mainfrom
fix/page-layout-direction-and-msvc-raw-string
Sep 6, 2026
Merged

fix(build): unbreak main — three PageLayout initializers and an msvc raw string#825
andiwand merged 1 commit into
mainfrom
fix/page-layout-direction-and-msvc-raw-string

Conversation

@andiwand

@andiwand andiwand commented Sep 6, 2026

Copy link
Copy Markdown
Member

🤖 Generated with Claude Code

main is red: its own build-test run for #820 fails three of the matrix jobs
(gcc-14, clang-18 -Werror, msvc-1940). Two independent causes, both from
already-merged work.

PageLayout::direction

#819 added direction to PageLayout and left three designated initializers
that name every other field, so -Wmissing-field-initializers refuses them:

  • iwork_document.cpp slide_page_layout
  • ppt_document.cpp slide_page_layout, both branches

Only the iwork one appears in the log — gcc stops at the first error, so the two
ppt sites were still hiding behind it. AppleClang does not warn here, which is
why it got through review locally.

The msvc raw string

odf_flat_file_test.cpp builds the writing-mode attribute inside an EXPECT_EQ
argument:

directions_of(three_paragraphs(
    "P1", R"(style:writing-mode=")" + std::string(mode) + "\""))

MSVC's traditional preprocessor does not recognise a raw string literal while
scanning a macro argument, so the " inside R"(…")" closes a string early and
the later "\"" lands outside one — error C2017: illegal escape sequence. The
attribute is now built into a local before the macro sees it, and the trailing
quote is a raw string too rather than an escape.

/Zc:preprocessor would fix the class of problem rather than this instance, but
it changes how every translation unit is preprocessed on msvc, which is not a
thing to slip into a red-main fix.

Verification

Full suite green (1442 passed, 6 skipped). The three initializer sites now
compile clean under gcc with -Wall -Wextra -Werror, checked locally against
libstdc++ — that is the warning surface AppleClang does not reproduce. The msvc
half only CI can confirm.

No CHANGELOG.md entry: nothing a consumer notices, and .direction was
already defaulting to the same empty value it now names.

#823 is rebased on top of this.

…every field

#819 added `PageLayout::direction` and left three designated initializers
naming every other field, which `-Wmissing-field-initializers` refuses under
gcc-14 and clang-18. gcc stops at the first, so only the iwork one was visible.

The msvc job fails separately: a raw string inside an `EXPECT_EQ` argument,
which the traditional preprocessor does not read, so the quotes inside it come
out as a stray escape. Built outside the macro instead.

main is red on all three today.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VEsRyBu8o4TGJGn3thNEDc
@andiwand
andiwand merged commit 9c4067d into main Sep 6, 2026
33 checks passed
@andiwand
andiwand deleted the fix/page-layout-direction-and-msvc-raw-string branch September 6, 2026 08:14
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.

1 participant