C/C++

C/C++

C/C++

Your one-stop destination to learn and collaborate about the latest innovations in IBM C/C++ for z/OS compilers to develop high-performing C/C++ applications and system programs on z/OS while maximizing hardware use and improving application performance.

 View Only
Expand all | Collapse all

Can the main() routine and CSECT share the same name in metal C?

  • 1.  Can the main() routine and CSECT share the same name in metal C?

    Posted Sat July 10, 2021 03:40 PM
    Hello,

    I'm trying to figure out if there is a way for the CSECT name and the main() routine to have the same name, for example, the CSECT and entry point names are both XYZENTRY.

    Looking at the discussion for #pragma csect and #pragma map would seem to indicate that it is not possible.

    If it isn't possible, what is the technical reason.  It is certainly possible in an assembler module.

    Thanks,
    Scott


  • 2.  RE: Can the main() routine and CSECT share the same name in metal C?

    Posted Tue September 28, 2021 04:06 PM
    Edited by Linda Chui Tue September 28, 2021 06:28 PM
    hi Scott,

    (posting on behalf of colleagues)
    Currently there is not a way for the CSECT name and the main() routine to have the same name. It is not a technical limitation and it is due to the way the code in the compiler (due to shared code between Metal C and regular C/C++ code) was written. if there is enough demand or need, compiler team can look to change it in a future release of the compiler.


    ------------------------------
    Linda Chui
    Compilation Technology & Enterprise Products
    IBM Canada
    ------------------------------



  • 3.  RE: Can the main() routine and CSECT share the same name in metal C?

    Posted Wed September 29, 2021 02:09 PM
    Ok, thank you.