Giter VIP home page Giter VIP logo

Comments (4)

asiekierka avatar asiekierka commented on June 2, 2024 1

I have no particular preference, I just wanted to highlight that the advertised feature does not work at all. Based on NeLua's experience, it seems that most C compilers print to stdout when given -E, but I've checked "retrocomputing" C compiles and it seems that the zcc wrapper from z88dk instead creates a .c.i files, and cc65 creates a .i file.

from gbdk-2020.

bbbbbr avatar bbbbbr commented on June 2, 2024

Sure, no problem to have lcc replace -c with -E for SDCC (when -E is specified to lcc). (Similar to how -S is handled)

Some implementation questions though:

  1. Does the preferred resolution to this also include emitting the preprocessor output to:

    • stdout?
    • To a file (if specified with -o)?
    • Or gcc -save-temps like behavior where output is written to matching .i files if requested?
  2. If yes to -o support: with multiple source files specified what is it expected?


Right now:

  • The output does not go to stdout
  • It only goes to a temp file (that gets deleted) even with -o specified
  • Output to .i files is suppressed (behavior inherited from the original code base)

With just allowing it to substitute -E it looks like:

 $ ../../../bin/lcc -E test.c
(shows no output in terminal)

With verbose on:

$ ../../../bin/lcc -v -E test.c
../../../bin/lcc $Id: lcc.c,v 2.0 2022/10/14 19:44:56 gbdk-2020 Exp $
"../../../"bin/sdcc -msm83 --no-std-crt0 --fsigned-char --use-stdout -D__PORT_sm83 -D__TARGET_gb -Wa-pogn -I"../../../"lib/gb -DINT_16_BITS -I"../../../"include -E test.c -o /tmp/lcc2393470.o
rm /tmp/lcc2393470.adb /tmp/lcc2393470.o /tmp/lcc2393470.asm /tmp/lcc2393470.lst /tmp/lcc2393470.sym

With verbose + output to a .i file (blocked)

$ ../../../bin/lcc -v -E test.c -o test.i
../../../bin/lcc $Id: lcc.c,v 2.0 2022/10/14 19:44:56 gbdk-2020 Exp $
../../../bin/lcc: -o would overwrite test.i  <-- (There is no actual test.i file to overwrite)

With verbose + output to a .temp file:

$ $ ../../../bin/lcc -v -E test.c -o test.temp
../../../bin/lcc $Id: lcc.c,v 2.0 2022/10/14 19:44:56 gbdk-2020 Exp $
"../../../"bin/sdcc -msm83 --no-std-crt0 --fsigned-char --use-stdout -D__PORT_sm83 -D__TARGET_gb -Wa-pogn -I"../../../"lib/gb -DINT_16_BITS -I"../../../"include -E test.c -o /tmp/lcc2420180.o
rm /tmp/lcc2420180.adb /tmp/lcc2420180.o /tmp/lcc2420180.asm /tmp/lcc2420180.lst /tmp/lcc2420180.sym

from gbdk-2020.

bbbbbr avatar bbbbbr commented on June 2, 2024

When you have a moment please try out the changes in #426.

  • -E
    • Goes to stdout by default (.c and .h files only)
    • Adding --save-preproc will output to matching .i files instead
    • Multiple files may be specified
    • No lcc -o single output file is supported

A build is here if that's convenient:
https://github.com/gbdk-2020/gbdk-2020/actions/runs/3271632514

from gbdk-2020.

asiekierka avatar asiekierka commented on June 2, 2024

Works great, thank you!

from gbdk-2020.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.