Skip to content

Deprecated score::StringLiteral in applicationcontext.h causes build failures in downstream consumers #214

@Chahult

Description

@Chahult

Description

Problem

score::StringLiteral was deprecated in score_baselibs with message:

"No longer supported. Use std::string, std::string_view, safecpp::zstring_view, or const char*"

applicationcontext.h still uses it in the constructor declaration (line 41):

ApplicationContext(const std::int32_t argc, const score::StringLiteral argv[]);

Since application.h #includes applicationcontext.h, any translation unit compiled
with -Werror,-Wdeprecated-declarations (COMPILER_WARNING_FEATURES) that transitively
includes application.h will fail with a build error.

Impact

20 targets in eclipse-score/config_management fail to build, including:

//score/config_management/config_daemon/code/app/details:app
//score/config_management/config_daemon/code/data_model:parameterset_collection
//score/config_management/config_daemon/code/factory:interface
//score/config_management/config_daemon/code/plugins:plugin
//score/config_management/config_daemon/code/json_helper:json_helper
(and 15 more targets)
Suggested Fix

Replace score::StringLiteral with const char* in applicationcontext.h ---this is a
fully compatible change since StringLiteral is an alias for const char*:

// Before
#include "score/memory/string_literal.h"
ApplicationContext(const std::int32_t argc, const score::StringLiteral argv[]);

// After
ApplicationContext(const std::int32_t argc, const char* const argv[]);

References:

https://github.com/eclipse-score/lifecycle/blob/main/src/lifecycle_client_lib/include/applicationcontext.h#L41
https://github.com/eclipse-score/baselibs/blob/main/score/memory/string_literal.h

Analysis results

No response

Solution

No response

Error Occurrence Rate

None

How to reproduce

No response

Supporting Information

No response

Classification

Minor

First Affected Release

not released (main)

Last Affected Release

not released (main)

Expected Fixed Release

before release (main)

Category

  • Safety Relevant
  • Security Relevant

Metadata

Metadata

Labels

No labels
No labels

Type

No fields configured for Bug.

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions