Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
No replies
KirkWolf
KirkWolf
8 Posts
ACCEPTED ANSWER

Pinned topic CCN3571 The external name must not conflict

‏2011-01-27T13:57:30Z |
Compiling a minimal program:




int hello () 
{ 

return 0; 
}


with:


xlc -S -qmetal hello.c


Results in this warning:


WARNING CCN3571 ./hello.c:1     The external name HELLO must not conflict with the name in pragma csect or the csect name generated by the compiler.


But looking at the output assembly source, there is no conflict that I can see:


TITLE 
'5694A01 V1.11 z/OS XL C                                X 000000 ./hello.c
'                                     000000 ACONTROL AFPR                                                   000000 HELLO#C  CSECT                                                           000000 HELLO#C  AMODE 31                                                        000000 HELLO#C  RMODE ANY 000000 SYSSTATE ARCHLVL=2                                              000000 * 

int hello () 
{                                                         000001 J     HELLO                                                     000001 DC    XL8
'00C300C300D50000'   Signature                         000001 DC    CL8
'20110127'              Compiled Date YYYYMMDD            000001 DC    CL6
'075228'            Compiled Time HHMMSS              000001 DC    XL4
'410B0000'          Compiler Version                  000001 DC    XL2
'0000'                                                 000001 DC    BL1
'00000000'         Flag Set 1                        000001 DC    BL1
'00000000'          Flag Set 2                        000001 DC    BL1
'00000000'          Flag Set 3                        000001 DC    BL1
'00000000'          Flag Set 4                        000001 DC    XL4
'00000000'                                             000001 ENTRY HELLO                                                     000001 HELLO    DS    0F                                                        000001 STM   14,15,12(13)                                              000001 LR    15,13                                                     000001 L     13,8(,13)                                                 000001 ST    15,4(,13)                                                 000001 @@BGN@1  DS    0H                                                        000001 USING @@AUTO@1,13                                               000001 *    

return 0; 000002 LA    15,0                                                      000002 * 
}                                                                      000003 @1L1        DS    0H                                                        000003 DROP                                                            000003 L     13,4(,13)                                                 000003 L     14,12(,13)                                                000003 BR    14                                                        000003 DS    0F                                                        000003 @@LIT@1  LTORG                                                           000000 EJECT                                                           000000 @@AUTO@1 DSECT                                                           000000 DS    XL80                                                      000000 ORG   @@AUTO@1                                                  000000 #GPR_SA_1 DS   18F                                                       000000 DS    F                                                         000000 *                                                                        000004 *                                                                        000005 END   ,(5694A01   ,1B00,11027)                                  000000
Updated on 2011-01-30T21:38:52Z at 2011-01-30T21:38:52Z by KirkWolf
  • brataj
    brataj
    11 Posts
    ACCEPTED ANSWER

    Re: CCN3571 The external name must not conflict

    ‏2011-01-28T14:17:49Z  in response to KirkWolf
    Hi Kirk,

    If you change the code to

    int hellox() {
        return 0;
    }
    


    you'll see that it's trying to make the CSECT name the same as the file name, at which point it would conflict with the entry name:

    TITLE '5694A01 V1.12 z/OS XL C
                              ./hello.c'
             ACONTROL AFPR
    HELLO    CSECT
    HELLO    AMODE 31
    HELLO    RMODE ANY
             SYSSTATE ARCHLVL=2
    * int hellox() {
             J     HELLOX
             ...
             ENTRY HELLOX
    HELLOX   DS    0F
             STM   14,15,12(13)
             LR    15,13
    


    To get rid of the warning, you can add the csect() option, it needs the ()'s, to your compile, which is in fact what the warning appears to enable behind the scenes to avoid the conflict.

    Bernie
    Updated on 2014-03-24T22:17:47Z at 2014-03-24T22:17:47Z by iron-man
    • KirkWolf
      KirkWolf
      8 Posts
      ACCEPTED ANSWER

      Re: CCN3571 The external name must not conflict

      ‏2011-01-28T14:28:43Z  in response to brataj
      Actually, in the original code it generates a CSECT HELLO#C and an ENTRY HELLO for the function.

      So, where's the conflict?
  • brataj
    brataj
    11 Posts
    ACCEPTED ANSWER

    Re: CCN3571 The external name must not conflict

    ‏2011-01-30T21:10:16Z  in response to KirkWolf
    The conflict was resolved by the compiler through the enabling of csect() before the code was generated, hence there's no apparent conflict in the generated code... and yes, it's somewhat confusing.
    • KirkWolf
      KirkWolf
      8 Posts
      ACCEPTED ANSWER

      Re: CCN3571 The external name must not conflict

      ‏2011-01-30T21:38:52Z  in response to brataj
      OK, I see. Thanks for your clarification.