Hot!xc8 v2 (c99) - long long (in stdlib.h), Int64 (in alltypes.h) will not compile (for pic16)

Author
glenntrimble
New Member
  • Total Posts : 12
  • Reward points : 0
  • Joined: 2018/06/18 14:26:12
  • Location: 0
  • Status: offline
2018/07/12 09:40:59 (permalink)
0

xc8 v2 (c99) - long long (in stdlib.h), Int64 (in alltypes.h) will not compile (for pic16)

The 8-bit compiler for 8-bit devices does not support a 64-bit type. The standard library files provided with the v2.0 compiler does have some protection for xc8 in some places,
 
#if defined(__XC8__)
 
but it appears there are some holes that need to be plugged.
 
Any chance this might get fixed in a forthcoming update of the compiler?
 
Thanks,
 
Glenn
#1

13 Replies Related Threads

    Jim Nickerson
    User 452
    • Total Posts : 5261
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: xc8 v2 (c99) - long long (in stdlib.h), Int64 (in alltypes.h) will not compile (for pi 2018/07/12 09:58:43 (permalink)
    +2 (2)
    To ensure the xc8 team gets your request you might open a support ticket at http://support.microchip.com
    post edited by Jim Nickerson - 2018/07/12 10:00:10
    #2
    1and0
    Access is Denied
    • Total Posts : 8392
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: xc8 v2 (c99) - long long (in stdlib.h), Int64 (in alltypes.h) will not compile (for pi 2018/07/12 11:34:25 (permalink)
    +2 (2)
    The 64-bit long long types are currently for the PIC18 devices only.
    #3
    glenntrimble
    New Member
    • Total Posts : 12
    • Reward points : 0
    • Joined: 2018/06/18 14:26:12
    • Location: 0
    • Status: offline
    Re: xc8 v2 (c99) - long long (in stdlib.h), Int64 (in alltypes.h) will not compile (for pi 2018/07/12 11:39:48 (permalink)
    0
    I know. I was compiling the bootloader application which includes stdio.h which includes stdlib.h which includes alltypes.h. I am not using code that needs a long long. There is code in these files that is not surrounded with a #if !defined(__XC8__) guard-band.
    #4
    mad_c
    Super Member
    • Total Posts : 1107
    • Reward points : 0
    • Joined: 2010/12/12 17:48:27
    • Location: Brisbane, Australia
    • Status: offline
    Re: xc8 v2 (c99) - long long (in stdlib.h), Int64 (in alltypes.h) will not compile (for pi 2018/07/12 13:57:29 (permalink)
    +2 (2)
    glenntrimble
    The 8-bit compiler for 8-bit devices does not support a 64-bit type.
     
    Any chance this might get fixed in a forthcoming update of the compiler?
     

    It is currently being added for enhanced mid-range devices, but 'smaller' devices will not support this type.
     
    Jeff.
    #5
    RISC
    Super Member
    • Total Posts : 5271
    • Reward points : 0
    • Status: offline
    Re: xc8 v2 (c99) - long long (in stdlib.h), Int64 (in alltypes.h) will not compile (for pi 2018/07/12 14:42:24 (permalink)
    0
    Hi
    Enhanced mid-range = PIC12Fxxxx / PIC16Fxxxx / PIC16Fyyyyy
    Regards
    #6
    glenntrimble
    New Member
    • Total Posts : 12
    • Reward points : 0
    • Joined: 2018/06/18 14:26:12
    • Location: 0
    • Status: offline
    Re: xc8 v2 (c99) - long long (in stdlib.h), Int64 (in alltypes.h) will not compile (for pi 2018/07/12 18:43:30 (permalink)
    0
    Jeff,
     
    Let me be more clear on this as I believe I have been misunderstood. I realize that the 8-bit PIC16 series does not support a 64-bit type. What I would like to see  fixed is additional guard-bands placed around types that the XC8 does not support. There are many of these already in the files, but there are a number of items that are not guard-band protected when you compile for the PIC16. The compiler group will know what I am talking about.
     
    Search the provided .h files for any type "long long", Int64, etc. and put a #if !defined(__XC8__) around it to keep it from being compiled.
     
    Glenn
    #7
    mbrowning
    Just a Member
    • Total Posts : 1090
    • Reward points : 0
    • Joined: 2005/03/16 14:32:56
    • Location: Melbourne, FL
    • Status: offline
    Re: xc8 v2 (c99) - long long (in stdlib.h), Int64 (in alltypes.h) will not compile (for pi 2018/07/12 19:46:20 (permalink)
    0
    Glenn - you were plenty clear

    Go Navy! Beat Army!
    #8
    mad_c
    Super Member
    • Total Posts : 1107
    • Reward points : 0
    • Joined: 2010/12/12 17:48:27
    • Location: Brisbane, Australia
    • Status: offline
    Re: xc8 v2 (c99) - long long (in stdlib.h), Int64 (in alltypes.h) will not compile (for pi 2018/07/12 20:16:39 (permalink)
    +2 (2)
    Hi,
     
    Sorry for the misunderstanding, but exactly what header file are you including and for what device are you building? There are three <stdlib.h> files provided by the compiler, for example, but you should not be nominating a path of which one to use. I can include <stdlib.h> using a 16F877 or 16F1937 with no error. The <alltypes.h> file you mentioned is only found in the musc "bits" directory, and I wouldn't have thought it was usable without explicitly providing a path to it, i.e. it is not for user consumption. Thanks.
     
    Jeff.
    #9
    qɥb
    Monolothic Member
    • Total Posts : 3329
    • Reward points : 0
    • Joined: 2017/09/09 05:07:30
    • Location: Jupiter
    • Status: offline
    Re: xc8 v2 (c99) - long long (in stdlib.h), Int64 (in alltypes.h) will not compile (for pi 2018/07/12 20:39:06 (permalink)
    0
    This is how he thinks it got included
    glenntrimble
    I know. I was compiling the bootloader application which includes stdio.h which includes stdlib.h which includes alltypes.h.
    ...




    This forum is mis-configured so it only works correctly if you access it via https protocol.
    The Microchip website links to it using http protocol. Will they ever catch on?
    PicForum "it just works"
    #10
    1and0
    Access is Denied
    • Total Posts : 8392
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: xc8 v2 (c99) - long long (in stdlib.h), Int64 (in alltypes.h) will not compile (for pi 2018/07/12 20:55:48 (permalink)
    +2 (2)
    I can #include <stdio.h> using a 16F887 and 16F1847 with no error.
     
    #11
    glenntrimble
    New Member
    • Total Posts : 12
    • Reward points : 0
    • Joined: 2018/06/18 14:26:12
    • Location: 0
    • Status: offline
    Re: xc8 v2 (c99) - long long (in stdlib.h), Int64 (in alltypes.h) will not compile (for pi 2018/07/13 10:48:30 (permalink)
    0
    I have found that if I use this file these compilation errors go away:
     
    add the following to the include path:
    C:\Program Files (x86)\Microchip\xc8\v2.00\pic\sources\c99\common
     
    #include <stdio_impl.h>
    #12
    mad_c
    Super Member
    • Total Posts : 1107
    • Reward points : 0
    • Joined: 2010/12/12 17:48:27
    • Location: Brisbane, Australia
    • Status: offline
    Re: xc8 v2 (c99) - long long (in stdlib.h), Int64 (in alltypes.h) will not compile (for pi 2018/07/15 14:03:11 (permalink)
    +3 (3)
    glenntrimble
    I have found that if I use this file these compilation errors go away:
     
    add the following to the include path:
     



    Okay, thanks, but it would be better if we could track down what is causing these errors, as you should not have to do any of this. When you say you were compiling "the bootloader application," do you mean one generated by MCC? If you have not done so already, I would send in a Support request with your project.
     
    Jeff.
     
    #13
    glenntrimble
    New Member
    • Total Posts : 12
    • Reward points : 0
    • Joined: 2018/06/18 14:26:12
    • Location: 0
    • Status: offline
    Re: xc8 v2 (c99) - long long (in stdlib.h), Int64 (in alltypes.h) will not compile (for pi 2018/07/23 07:09:36 (permalink)
    0
    I have already created a support request and just uploaded my project.
     
    Glenn
    #14
    Jump to:
    © 2018 APG vNext Commercial Version 4.5