#1846 SDCC shows wrong line number in warning 94

closed-fixed
5
2013-05-25
2011-09-13
No

1: Sample code that reproduces the problem.

Source file is attached.

2: Exact command used to run SDCC on this sample code

sdcc -mz80 --code-loc 26000 --data-loc 0xF800 --no-std-crt0 --opt-code-size --max-allocs-per-node 1 --funsigned-char --disable-warning 85 -L z80 Basic.c

3: SDCC version tested (type "sdcc -v" to find it)
SDCC : mcs51/gbz80/z80/ds390/pic16/pic14/TININative/ds400/hc08 3.0.4 #6849 (Sep 13 2011) (MINGW32)

It is old problem. It present in old SDCC versions, for example, in SDCC 3.0.4 #6712 (MINGW32), and also it is in new build too.

4: Copy of the error message or incorrect output, or a clear description of the observed versus expected behavior.

Compiler shows:
Basic.c:62: warning 94: comparison is always true due to limited range of data type

but real line number of warning 94 is not 62, but 70. This is a special event when number of the line shows incorrect. Though if change or remove several unessential lines, that all become it is correct.

5. My e-mail is allot [(at)] bk.ru

Discussion

  • Oleg N. Cher

    Oleg N. Cher - 2011-09-13

    Source that reproduces the problem

     
  • Maarten Brock

    Maarten Brock - 2011-09-16
    • labels: 101552 --> C Preprocessor
     
  • Maarten Brock

    Maarten Brock - 2011-09-16

    The preprocessor incorrectly inserts # 29 in Basic_Init

    RES 4,1(IY)
    # 29 "bug3408654.c"
    __endasm;
    }

     
  • Borut Ražem

    Borut Ražem - 2011-10-16
    • milestone: --> fixed
    • assigned_to: nobody --> borutr
    • status: open --> closed-fixed
     
  • Borut Ražem

    Borut Ražem - 2011-10-16

    Fixed in svn revision #6974: disabled # LINE directive generation in __asm __endasm block.

    Borut

     

Log in to post a comment.