• AVR Freaks

Hot!warning: Negative offset for 'variable'

Author
Szidor
Super Member
  • Total Posts : 159
  • Reward points : 0
  • Joined: 2013/11/20 03:39:27
  • Location: Budapest
  • Status: offline
2015/01/22 08:01:30 (permalink)
0

warning: Negative offset for 'variable'

Hi!
 
What does the warning "Negative offset for 'variable'" mean? "variable" is the name of a global static data variable.
 
Thanks,
Szidor
#1

2 Replies Related Threads

    crosland
    Super Member
    • Total Posts : 2142
    • Reward points : 0
    • Joined: 2005/05/10 10:55:05
    • Location: Warks, UK
    • Status: offline
    Re: warning: Negative offset for 'variable' 2015/01/22 08:44:00 (permalink)
    -2 (2)
    Have you tried the list of errors in compiler user guide?
     
    #2
    hbutz
    New Member
    • Total Posts : 20
    • Reward points : 0
    • Joined: 2011/09/09 05:36:30
    • Location: 0
    • Status: offline
    Re: warning: Negative offset for 'variable' 2020/11/30 12:48:10 (permalink)
    -1 (1)
    In one of the compiler release notes this is mentioned that this warning appears "too often."
     
    What i noted was I had declared storage for a global array.  In the header module, I declared this as "extern" and duplicated the array size.  This did some odd things - seems it did not properly allocate the storage and was overridden by something else (my guess).
     
    What I did to fix it was removed the size of the array in the header file so it just said, "extern int variable[]" while the global declaration said, "int variable[14]".
    #3
    Jump to:
    © 2021 APG vNext Commercial Version 4.5