CNA-BUG-092: Public non-XNA members Texture::GetFormatSizeEXT, GetBlockSizeSquaredEXT, GetPixelStoreAlignment, ValidateGetDataFormat and GameWindow's IsBorderlessEXT accessors carry no CNAEXT marker

CNA snapshot 009d40f5  ·  Known Issues › Current bugs  ·  source links pinned to 009d40f5

✓

Evidence basis: source-verified at the pinned commit. Claims on this page were checked by reading the CNA source at commit 009d40f5; unless a sentence says otherwise, nothing here was built or executed. Nothing on this page was executed unless the Evidence section says so.

Four public static Texture helpers and the GameWindow borderless getter and setter are not XNA 4.0 API but are not tagged CNAEXT, so a CNA_STRICT_XNA_API build compiles calls to them silently.

Identifier
CNA-BUG-092
Category
Bug
Subsystem
Core & runtime
Status
Open
Verified against
CNA 009d40f5 (009d40f5dd085c4e674d3479675fac84b12b3e0a)
Severity
Low (a triage suggestion, not a project priority)
Evidence basis
Source-verified: read at TARGET, not executed
Tests touching this area
None
Affected contract
CNAEXT marker rule; Texture::GetBlockSizeSquaredEXT, Texture::GetFormatSizeEXT, Texture::GetPixelStoreAlignment, Texture::ValidateGetDataFormat, GameWindow::getIsBorderlessEXTProperty, GameWindow::setIsBorderlessEXTProperty

Expected behaviour

CNA's port checklist (CHECKLIST.md, section “CNAEXT markers”) requires every method, field or type alias outside the XNA 4.0 API surface to be marked CNAEXT. CNAHelper.hpp makes the marker enforceable: with CNA_STRICT_XNA_API defined it expands to [[deprecated]], so a strict build with -Werror=deprecated-declarations refuses every call to a non-XNA member.

Actual behaviour at TARGET

In the public section of Texture.hpp the static helpers GetBlockSizeSquaredEXT, GetFormatSizeEXT, GetPixelStoreAlignment and ValidateGetDataFormat are declared without the marker, while their neighbours ValidateFormat and IsFormatAllowedByProfileEXT carry it. GameWindow.hpp declares getIsBorderlessEXTProperty and setIsBorderlessEXTProperty unmarked, next to the marked MinimizeEXT and RestoreEXT. None of the six exists in XNA 4.0, so a strict build accepts calls to them.

Source locations

Evidence

Checked by reading the two headers, CNAHelper.hpp and CHECKLIST.md at 009d40f5; not executed. The genuine XNA 4.0 IL in the reference cache has no IsBorderless, GetFormatSize, GetBlockSizeSquared or GetPixelStoreAlignment member. The same defect class for Point's arithmetic operators is recorded separately (CNA-BUG-075). No whole-surface scan for further unmarked members was made; the six named members are the verified set.

Focused reproduction

// Illustrative; not compiled. Build with -DCNA_STRICT_XNA_API -Werror=deprecated-declarations.
#include "Microsoft/Xna/Framework/Graphics/Texture.hpp"
using namespace Microsoft::Xna::Framework::Graphics;
int probe() { return Texture::GetFormatSizeEXT(SurfaceFormat::Color); }
// Expected: a deprecated-declaration error (non-XNA member). Actual: compiles.

Current tests

The only strict-mode tests, StrictXnaApiSurfaceCheck_Compile_Run and StrictXnaApiSurfaceLeakCheck_MustFailToCompile in Harnesses.cmake, compile the Microsoft::Devices sensor surface only (see the separate entry on strict-mode coverage), so nothing exercises these members under the strict macro.

Regression test

A must-fail compile test in the style of StrictXnaApiSurfaceLeakCheck_MustFailToCompile that calls each named member under CNA_STRICT_XNA_API. The fix is adding CNAEXT to the six declarations.

Blast radius

Only projects that rely on CNA_STRICT_XNA_API to prove they stay inside the XNA 4.0 surface: calls to these members pass unnoticed. Runtime behaviour is unaffected.

Workaround

Search a port for the named members when auditing XNA purity.

The same subject is explained at several altitudes. These are the neighbouring pages at each one.

Known issues
Bug index