Menu

#244 unicon -c stressCo : compile err unless -fa

None
open
nobody
iconc (42)
5
2021-09-21
2017-05-20
No

see test program stressCo.icn in bug [#242]
It does no string-invoke, but
without -fa, it fails to compile:

$UNICON -C stressCo
Parsing stressCo.icn: .......
Parsing /aufs/uni5197mtnoc/bin/../ipl/procs/posix.icn: .........
/home/kubuntu/unicon/bin/iconc -U1 -o stressCo -A /tmp/kubuntu/uni12494008 /tmp/kubuntu/uni12038686-iconc /tmp/kubuntu/uni21083446-iconc
Translating to C:
No errors; no warnings
Compiling and linking C code:
stressCo.c: In function ‘P00m_main’:
stressCo.c:1367:4: warning: implicit declaration of function ‘P003_A’ [-Wimplicit-function-declaration]
P003_A(&(*r_pfp).t.d[9]);
^~~~~~
stressCo.c: In function ‘P00o_main’:
stressCo.c:1410:4: warning: implicit declaration of function ‘P005_C’ [-Wimplicit-function-declaration]
P005_C();
^~~~~~
/tmp/kubuntu/ccupnuxx.o: In function P00o_main': stressCo.c:(.text+0x747): undefined reference toP005_C'
/tmp/kubuntu/ccupnuxx.o: In function P00m_main': stressCo.c:(.text+0x19cd): undefined reference toP003_A'
collect2: error: ld returned 1 exit status
C compile and link failed

Related

Bugs: #242

Discussion

  • Clinton Jeffery

    Clinton Jeffery - 2017-05-21
    • labels: iconc --> iconc
    • Group: -->
     
  • Clinton Jeffery

    Clinton Jeffery - 2017-05-21

    This reproduces for me. It is likely that the compiler determines that a, b, and c are never activated, so A(), B(), and C() are never called, so it is omitting the code for them, but obviously it is not omitting the create code, which contains links to them, so this is a bug. Thanks for the -fs workaround observation.

     
  • Charles Evans

    Charles Evans - 2017-06-10

    trivia:
    in tests/coexpr:
    unicon -C cobench
    ./cobench
    # ^ works.

     
  • Charles Evans

    Charles Evans - 2017-06-13

    Works now after [r5274], thanks for the fix. Ok to close this.

     

    Related

    Commit: [r5274]

  • Charles Evans

    Charles Evans - 2017-06-13

    Or maybe: new title:
    unicon -C -nofs stressCo # fails

     
  • Charles Evans

    Charles Evans - 2017-06-17

    Also, for completeness, naturally
    iconc stressCo
    # ^ fails
    iconc -fa stressCo
    # ^ works

     
  • Charles Evans

    Charles Evans - 2021-09-21

    snapshot 9/6:
    iconc stressCo
    now works.
    Ok to close this.

     

Log in to post a comment.