Valac generates invalid C source (const gchar * + const char *)

Bug #1129863 reported by Hibou57 (Yannick Duchêne)
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
vala-0.14 (Ubuntu)
New
Undecided
Unassigned

Bug Description

Using the source given as an attached file (not the real application, I stripped as much as possible from it), compilation using the options given below, terminates with this error:

    Compilation failed: 1 error(s), 0 warning(s)
    <cwd>/bug.vala.c: In function ‘setup_xdg_data_dirs_env_variable’:
    <cwd>/bug.vala.c:294:21: erreur: invalid operands to binary + (have ‘const gchar *’ and ‘const char *’)

Using `valac` invoked as in (recalled in the attached source file):

    valac \
       --enable-checking \
       --enable-experimental \
       --enable-experimental-non-null \
       --enable-version-header \
       --pkg gtk+-3.0 \
       --vapidir=/usr/share/vala-0.14/vapi/ \
       "bug.vala";

-----

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: valac 0.14.2-0ubuntu1
ProcVersionSignature: Ubuntu 3.2.0-37.58-generic-pae 3.2.35
Uname: Linux 3.2.0-37-generic-pae i686
ApportVersion: 2.0.1-0ubuntu17.1
Architecture: i386
CheckboxSubmission: 9b39dc487a858b4cfa15c3a2f5fa50d5
CheckboxSystem: d00f84de8a555815fa1c4660280da308
Date: Tue Feb 19 07:48:34 2013
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release i386 (20120423)
MarkForUpload: True
PackageArchitecture: all
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 LANG=fr_FR.UTF-8
 SHELL=/bin/bash
SourcePackage: vala-0.14
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Hibou57 (Yannick Duchêne) (yannick-duchene) wrote :
Revision history for this message
Hibou57 (Yannick Duchêne) (yannick-duchene) wrote :

I've noticed the error disappears if this `valac` option is removed:

    --enable-experimental-non-null

(I'm unlucky, as I love the idea of this kind of check).

As a workaround for now, running `valadoc` with the same option, does not make it fails, checks the source and points any error about conversion attempt like from `string?` to `string`. Finally I can disable the option for compiling and keep it for document generation, which becomes a kind of added check.

Would still be better if using this option would not result in invalid C source generation.

How is it supposed to impact C source generation? Though it was only about static checking...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.