ARM Technical Support Knowledge Articles

CALL GIVES WARNING L21 (DATA TYPES SLIGHTLY DIFFERENT)

Applies to: A166 Macro Assembler

Answer


Information in this article applies to:


QUESTION

I have written an assembler program and at the linker level I get the message: WARNING L21: DATA TYPES SLIGHTLY DIFFERENT. Why do I get this warning and how can I avoid it?

Below is my simplified program example:

TEST1.A66

$SEGMENTED CASE

?PR?TEST SECTION CODE WORD 'FCODE'

PUBLIC  func1
PUBLIC  func2

func1   PROC FAR
        NOP
func2:  NOP
        RET
func1   ENDP

?PR?TEST ENDS

END

TEST2.A66

$SEGMENTED CASE

EXTERN  func1: FAR
EXTERN  func2: FAR

?PR?TEST2  SECTION  CODE WORD 'FCODE'

TEST2   PROC  FAR
        CALL  func1
        CALL  func2
        RET
TEST2   ENDP

?PR?TEST2 ENDS

        END

The Linker outputs:

*** WARNING L21: DATA TYPES SLIGHTLY DIFFERENT
    SYMBOL:  func2
    MODULE:  A1.OBJ (A1)

ANSWER

This warning indicates that the linker assumes a different definition for the PUBLIC symbol func2. By default, all labels are considered as NEAR, therefore you get this linker warning. You can avoid this warning when you define the label as FAR.

Modified source code of module TEST1.A66:

  :
  :
func1   PROC FAR
        NOP
func2:  LABEL FAR
        NOP
        RET
func1   ENDP
  :
  :

Article last edited on: 2006-01-31 18:20:22

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential