×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 19

Thread: GCCE issues

  1. #1
    Registered User
    Join Date
    Sep 2003
    Posts
    11

    GCCE issues

    When compiling using GCCE supplied with 3rd ed SDK beta, I have noticed a few issues. Same code compiles & runs perfectly in emulator.

    1. For some reason unknown to me, it compiles derived templated classes incorrectly. Say I have a template<class T> class Bar and template<class T> class Foo : public Bar<T>, the functions declared in Foo<T> do not see variables derived from Bar. Any ideas? If GCCE really has problems with these, it is a major issue.

    2. It is included in the release notes that GCCE has "issues" with va_list macros. How to circumvent those issues? Having a large codebase with snprintf-like functions, it is quite a limitation not to have a standard ANSI C compliant compiler.

    3. static_cast<> is not handled correctly and it gives just compilation errors. Changing static_cast to just C-like cast is a workaround.

    4. GCCE does not seem to accept some ASCII characters in string literals, like °, »

    <slightly off-topic>
    5. On Metrowerks compiler, ? operator is sometimes compiled incorrectly. (a & b) == 0 ? false : true in some places always evaluates to false independent of a and b. Same thing noticed in earlier SDK's GCC, only if char * typed values are in the ? : part.

  2. #2
    Registered User
    Join Date
    Dec 2004
    Posts
    17

    Re: GCCE issues

    Hi Apsaarin,

    I'm having some problems with :
    VA_LIST ap;
    VA_START( ap, pn );
    VA_END( ap );.

    It had some errors like "request for member `__ap' in `ap', which is of non-class type `char*"

    I see from your messagee that you might have encountered this type problem. Did you have any of these problems, if so, how did you get around ? Any help would be great. Thanks

  3. #3
    Registered User
    Join Date
    Sep 2003
    Posts
    11

    Re: GCCE issues

    To my knowledge there is no known workaround right now for this va_list issue, but Symbian is investigating the problem and hopefully they'll get a fix someday.

  4. #4
    Registered User
    Join Date
    Dec 2004
    Posts
    17

    Re: GCCE issues

    Thanks Apsaarin.

  5. #5
    Registered User
    Join Date
    Nov 2005
    Location
    Manchester, England
    Posts
    8

    Re: GCCE issues

    Hi,

    Symbian does have some information on this problem:

    http://www3.symbian.com/faq.nsf/0/1C...C?OpenDocument

    If this link fails search for FAQ-1207

    Thanks.

  6. #6
    Registered User
    Join Date
    Dec 2004
    Posts
    17

    Re: GCCE issues

    Thanks Cartmon,

    I found the FAQ too, but it does not resolve the problem because the compiler error is at VA_START, even before you use the argument list.

  7. #7
    Registered User
    Join Date
    Oct 2005
    Posts
    40

    Cool Re: GCCE issues

    Hi,

    The problem comes from va_list being defined twice.

    stdarg_e.h defines it as typedef char* __e32_va_list;
    while stdarg.h defines it as #define va_list __e32_va_list
    and gcce.h as typedef va_list __e32_va_list;

    If you look into the definition of va_start(), va_arg() and va_end() in stdarg_e.h you'll find that the first declaration is the one to keep so simply comment out the two others and compile.

    stdarg.h and starg_e.h are in include/libc
    gcce.h is in include/gcce

    GreG

  8. #8
    Regular Contributor
    Join Date
    May 2005
    Location
    Brasov, Romania
    Posts
    431

    Re: GCCE issues

    Quote Originally Posted by Greg_Jokiel
    If you look into the definition of va_start(), va_arg() and va_end() in stdarg_e.h you'll find that the first declaration is the one to keep so simply comment out the two others and compile.

    stdarg.h and starg_e.h are in include/libc
    gcce.h is in include/gcce
    But is it ok to comment the lines from the other headers?

  9. #9
    Registered User
    Join Date
    Oct 2005
    Posts
    40

    Re: GCCE issues

    Quote Originally Posted by iulian_moldovan
    But is it ok to comment the lines from the other headers?
    Well, variable lists work as intended on the device so this is good enough for me.

    GreG

  10. #10
    Regular Contributor
    Join Date
    May 2005
    Location
    Brasov, Romania
    Posts
    431

    Re: GCCE issues

    The same problem is also on the released SDK.
    Will this have a reasonable solution sometime?

  11. #11
    Registered User
    Join Date
    Sep 2006
    Posts
    47

    Re: GCCE issues

    An update on this old thread.

    In my case the error was that stdarg used:
    typedef char* __e32_va_list;

    while gcce.h uses:
    typedef struct __va_list { void *__ap; } va_list;
    typedef va_list __e32_va_list;

    In my code I had a function like:

    myFunc(va_list *np)
    {
    va_arg(*np,blabla);
    }

    This failed with:
    error: first argument to `va_arg' not of type `va_list'
    error: request for member `__ap' in something not a structure or union

    Due to that va_arg(*np,blabla); should be va_arg((*np),blabla); since it now was a struct and not a char*.

    I hope this fixes it for the rest of you too :)

  12. #12
    Registered User
    Join Date
    Mar 2003
    Posts
    23

    Re: GCCE issues

    Thanks Martin.

  13. #13
    Registered User
    Join Date
    Mar 2010
    Posts
    4

    Re: GCCE issues

    Hello,

    I am using the new Nokia Qt SDK (RC) and I'm also facing the error 'first argument to 'va_arg' not of type 'va_list'' when compiling for Symbian release-gcce.
    stdarg.h includes stdarg_e.h. My guess is that stdarg_e.h and gcce.h conflict but I can't include gcce.h again.

    The va_list code is used in the Lua library. It all works fine with the older S60 3rd FP2 SDK.

    Any suggestions?
    Last edited by dutchmega; 2010-06-16 at 15:31.

  14. #14
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: GCCE issues

    can you show us the exact compiler out.

  15. #15
    Registered User
    Join Date
    Mar 2010
    Posts
    4

    Re: GCCE issues

    Sure. You can find the exact output at http://pastebin.com/vMQcj8tj

Similar Threads

  1. 6820 memory issues
    By jennydeng in forum Mobile Java General
    Replies: 2
    Last Post: 2009-09-15, 18:33
  2. GCCE compile warnings using S60 3rd ed SDK
    By RyanSantos in forum Symbian Tools & SDKs
    Replies: 4
    Last Post: 2006-02-22, 02:45
  3. Replies: 0
    Last Post: 2005-11-16, 09:21
  4. Issues in latest NDS
    By Paul.Todd in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2005-09-12, 10:43
  5. Series 60 graphics and sound issues
    By Teh_Architect in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2005-08-08, 11:03

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •