After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 471244 - C code generator doesn't take any dependencies into account
C code generator doesn't take any dependencies into account
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Code Generator
0.3.x
Other All
: Normal minor
: ---
Assigned To: Jürg Billeter
Vala maintainers
: 511864 539892 543873 548284 549678 (view as bug list)
Depends on: 572536
Blocks:
 
 
Reported: 2007-08-28 18:10 UTC by Ed Schouten
Modified: 2009-03-30 22:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test case (205 bytes, text/plain)
2007-09-12 13:36 UTC, Clément DAVID (IRC: davidcl)
Details

Description Ed Schouten 2007-08-28 18:10:38 UTC
Please describe the problem:
The vala compiler bails out when the following piece of code is compiled:

class A : B {
}
class B {
}

with the following error messages:

test.c:19: error: field 'parent' has incomplete type
test.c:23: error: field 'parent' has incomplete type
error: cc exited with status 256
Compilation failed: 1 error(s), 0 warning(s)

This is because the B and BClass structs are already used before they are declared. This is because C uses a single pass compiler.

Steps to reproduce:


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Ed Schouten 2007-08-28 18:20:15 UTC
Strange thing is: it only happens with Vala from SVN; not 0.1.2.
Comment 2 Jürg Billeter 2007-08-28 18:31:32 UTC
Confirming, happens with trunk and 0.1.2 here.
Comment 3 Clément DAVID (IRC: davidcl) 2007-09-12 13:36:08 UTC
Created attachment 95439 [details]
Test case
Comment 4 Clément DAVID (IRC: davidcl) 2007-09-12 13:36:58 UTC
Comment on attachment 95439 [details]
Test case

Appears to be fixed in SVN rev 600
Comment 5 Jürg Billeter 2007-12-04 19:02:35 UTC
This is still broken in trunk.
Comment 6 Jürg Billeter 2008-01-26 10:35:53 UTC
*** Bug 511864 has been marked as a duplicate of this bug. ***
Comment 7 Jürg Billeter 2008-05-02 19:06:52 UTC
*** Bug 530063 has been marked as a duplicate of this bug. ***
Comment 8 Jaap A. Haitsma 2008-05-31 09:40:42 UTC
Jürg,

I'm still running vala with the patch I've attached in  Bug 530063. Otherwise my code does not compile. I'm surprised to see that this bug has severity minor and priority low. 

Jaap
Comment 9 Jürg Billeter 2008-09-27 12:11:12 UTC
*** Bug 548284 has been marked as a duplicate of this bug. ***
Comment 10 Jürg Billeter 2008-12-13 09:58:40 UTC
*** Bug 549678 has been marked as a duplicate of this bug. ***
Comment 11 Jürg Billeter 2009-01-16 22:32:44 UTC
*** Bug 539892 has been marked as a duplicate of this bug. ***
Comment 12 Jürg Billeter 2009-01-17 22:19:26 UTC
*** Bug 543873 has been marked as a duplicate of this bug. ***
Comment 13 Jürg Billeter 2009-03-30 22:36:06 UTC
commit 2d4a4a264677b42710914907f63e1624e25e560f
Author: Jürg Billeter <j@bitron.ch>
Date:   Tue Mar 31 00:31:07 2009 +0200

    Rework header file generation
    
    Generate single C header file for public API, do not use header
    files for internal API. Fixes bug 471244, bug 571037, bug 572536,
    and bug 575629.