Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • G GLib
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 853
    • Issues 853
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 54
    • Merge requests 54
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • GLib
  • Issues
  • #2748
Closed
Open
Issue created Sep 13, 2022 by Simon McVittie@smcvMaintainer

construct properties always trigger the deprecated property warning

To reproduce:

G_DEBUG=fatal-warnings G_ENABLE_DIAGNOSTIC=1 gdb --args gio info file:///

for which the important part is that GDBus calls into g_socket_client_new() which constructs a GSocketClient with default properties:

g_object_new (G_TYPE_SOCKET_CLIENT, NULL);

Expected result: no warning, because the deprecated GSocketClient:tls-validation-flags property was correctly not specified

Actual result:

(gio info:244202): GLib-GObject-WARNING **: 09:57:15.537: The property GSocketClient:tls-validation-flags
is deprecated and shouldn't be used anymore. It will be removed in a future version.

(followed by a crash because I used G_DEBUG=fatal-warnings)

From the backtrace, this appears to be because g_object_new_internal() sets all construct properties to their default values by calling object_set_property(), but object_set_property() does not have a way to know which ones were explicitly provided by the user in a GObjectConstructParam and which ones are just being set to their defaults.

Edited Sep 13, 2022 by Simon McVittie
Assignee
Assign to
Time tracking