Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
vala
vala
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 702
    • Issues 702
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 39
    • Merge Requests 39
  • Operations
    • Operations
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • External Wiki
    • External Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
  • GNOME
  • valavala
  • Issues
  • #595

Closed
Open
Opened Aug 31, 2017 by bugzilla-migration@bugzilla-migrationReporter

Vala generates invalid C code with SimpleType structures defined as arrays

Submitted by smx..@..il.com

Link to original bug (#787091)

Description

Created attachment 358866 proposed patch

If the struct being moved is an array, and was declared as [SimpleType], the generated code will fail to compile with

error: assignment to expression with array type

This happens because the left part of the assignment is an array, and as such it's not directly modifiable.

The first idea was to use a custom copy_function, but Vala ignores it in these cases.

The attached patch adds handling for a copy_function with this prototype, if provided by the user:

void foo_copy(foo source, foo dest);

thanks to Rico Tzschichholz for wrapping up a unit test

Patch 358866, "proposed patch":
structs_copy_function.patch

See also

  • Bug 627528
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
0.48
Milestone
0.48
Assign milestone
Time tracking
None
Due date
None
Reference: GNOME/vala#595