GDCC: An Alternative ACS Compiler [0.15.0]

Any utility that assists in the creation of mods, assets, etc, go here.
Forum rules
The Projects forums are ONLY for YOUR PROJECTS! If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.

Re: GDCC: An Alternative ACS Compiler

Postby DavidPH » Thu Nov 03, 2016 5:24 pm

Updated.
User avatar
DavidPH
Crazy Compiler Man
 
Joined: 28 Aug 2009

Re: GDCC: An Alternative ACS Compiler

Postby Nash » Wed Jan 11, 2017 5:16 am

Requesting local parameter to PlaySound: https://github.com/rheit/acc/commit/ba6 ... 6d6cc23a14
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: GDCC: An Alternative ACS Compiler

Postby bitshifter » Fri Jan 13, 2017 2:45 pm

Hi.

I've been trying to compile GDCC on Mac (10.9.5) yet the compile fails (on any branch), for the current master (https://github.com/DavidPH/GDCC) branch, I get the output below. It used LLVM 6.0 but I do have gcc5 5.4.0_0 installed.

Thanks.

Code: Select allExpand view
a@Droid-Pro:~/Desktop/GDCC-master$ mkdir build
a@Droid-Pro:~/Desktop/GDCC-master$ cd build
a@Droid-Pro:~/Desktop/GDCC-master/build$ cmake ..
-- The C compiler identification is AppleClang 6.0.0.6000057
-- The CXX compiler identification is AppleClang 6.0.0.6000057
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test GDCC_FLAG_CXX_Wall
-- Performing Test GDCC_FLAG_CXX_Wall - Success
-- Performing Test GDCC_FLAG_CXX_Wextra
-- Performing Test GDCC_FLAG_CXX_Wextra - Success
-- Performing Test GDCC_FLAG_CXX_Wpedantic
-- Performing Test GDCC_FLAG_CXX_Wpedantic - Success
-- Performing Test GDCC_FLAG_CXX_Wshadow
-- Performing Test GDCC_FLAG_CXX_Wshadow - Success
-- Performing Test GDCC_FLAG_CXX_Wno_misleading_indentation
-- Performing Test GDCC_FLAG_CXX_Wno_misleading_indentation - Failed
-- Performing Test GDCC_FLAG_CXX_CXX11
-- Performing Test GDCC_FLAG_CXX_CXX11 - Success
-- Found GMP: /usr/local/lib/libgmp.dylib;/usr/local/lib/libgmpxx.dylib 
-- Configuring done
CMake Warning (dev):
  Policy CMP0042 is not set: MACOSX_RPATH is enabled by default.  Run "cmake
  --help-policy CMP0042" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  MACOSX_RPATH is not specified for the following targets:

   gdcc-acc-lib
   gdcc-ar-lib
   gdcc-ar-wad-lib
   gdcc-as-lib
   gdcc-bc-lib
   gdcc-bc-mgc-lib
   gdcc-bc-zdacs-lib
   gdcc-cc-lib
   gdcc-core-lib
   gdcc-cpp-lib
   gdcc-ir-lib
   gdcc-ld-lib
   gdcc-ntsc-lib
   gdcc-option-lib
   gdcc-platform-lib
   gdcc-sr-lib

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /Users/a/Desktop/GDCC-master/build
a@Droid-Pro:~/Desktop/GDCC-master/build$ make
Scanning dependencies of target gdcc-option-lib
[  0%] Building CXX object src/Option/CMakeFiles/gdcc-option-lib.dir/Base.cpp.o
[  0%] Building CXX object src/Option/CMakeFiles/gdcc-option-lib.dir/CStr.cpp.o
[  0%] Building CXX object src/Option/CMakeFiles/gdcc-option-lib.dir/CStrV.cpp.o
[  1%] Building CXX object src/Option/CMakeFiles/gdcc-option-lib.dir/Exception.cpp.o
[  1%] Building CXX object src/Option/CMakeFiles/gdcc-option-lib.dir/Program.cpp.o
[  1%] Building CXX object src/Option/CMakeFiles/gdcc-option-lib.dir/Program/Process.cpp.o
[  2%] Building CXX object src/Option/CMakeFiles/gdcc-option-lib.dir/Program/Put.cpp.o
[  2%] Building CXX object src/Option/CMakeFiles/gdcc-option-lib.dir/StrUtil.cpp.o
[  2%] Linking CXX shared library libgdcc-option-lib.dylib
[  2%] Built target gdcc-option-lib
Scanning dependencies of target gdcc-core-lib
[  2%] Building CXX object src/Core/CMakeFiles/gdcc-core-lib.dir/BinaryIO.cpp.o
[  2%] Building CXX object src/Core/CMakeFiles/gdcc-core-lib.dir/Counter.cpp.o
[  3%] Building CXX object src/Core/CMakeFiles/gdcc-core-lib.dir/Dir.cpp.o
[  3%] Building CXX object src/Core/CMakeFiles/gdcc-core-lib.dir/Exception.cpp.o
[  3%] Building CXX object src/Core/CMakeFiles/gdcc-core-lib.dir/File.cpp.o
[  3%] Building CXX object src/Core/CMakeFiles/gdcc-core-lib.dir/Number.cpp.o
[  4%] Building CXX object src/Core/CMakeFiles/gdcc-core-lib.dir/Option.cpp.o
[  4%] Building CXX object src/Core/CMakeFiles/gdcc-core-lib.dir/Origin.cpp.o
[  4%] Building CXX object src/Core/CMakeFiles/gdcc-core-lib.dir/ParseNumber.cpp.o
[  5%] Building CXX object src/Core/CMakeFiles/gdcc-core-lib.dir/ParseString.cpp.o
[  5%] Building CXX object src/Core/CMakeFiles/gdcc-core-lib.dir/Path.cpp.o
[  5%] Building CXX object src/Core/CMakeFiles/gdcc-core-lib.dir/String.cpp.o
[  6%] Building CXX object src/Core/CMakeFiles/gdcc-core-lib.dir/StringGen.cpp.o
[  6%] Building CXX object src/Core/CMakeFiles/gdcc-core-lib.dir/StringOption.cpp.o
[  6%] Building CXX object src/Core/CMakeFiles/gdcc-core-lib.dir/Warning.cpp.o
[  7%] Linking CXX shared library libgdcc-core-lib.dylib
[  7%] Built target gdcc-core-lib
Scanning dependencies of target gdcc-platform-lib
[  8%] Building CXX object src/Platform/CMakeFiles/gdcc-platform-lib.dir/Alloc.cpp.o
[  8%] Building CXX object src/Platform/CMakeFiles/gdcc-platform-lib.dir/Platform.cpp.o
[  8%] Linking CXX shared library libgdcc-platform-lib.dylib
[  8%] Built target gdcc-platform-lib
Scanning dependencies of target gdcc-ir-lib
[  8%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Addr.cpp.o
[  8%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Arg.cpp.o
[  8%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Block.cpp.o
[  9%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/CallType.cpp.o
[  9%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Code.cpp.o
[  9%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/DJump.cpp.o
[ 10%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Exp.cpp.o
[ 10%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Exp/Binary.cpp.o
[ 10%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Exp/Branch.cpp.o
[ 11%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Exp/Glyph.cpp.o
[ 11%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Exp/Multi.cpp.o
[ 11%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Exp/Unary.cpp.o
[ 12%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Exp/Value.cpp.o
[ 12%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Function.cpp.o
[ 12%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Glyph.cpp.o
[ 13%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/IArchive.cpp.o
[ 13%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Import.cpp.o
[ 13%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Linkage.cpp.o
[ 13%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/OArchive.cpp.o
[ 14%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Object.cpp.o
[ 14%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/OpCode.cpp.o
[ 14%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Program.cpp.o
[ 15%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/ScriptType.cpp.o
[ 15%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Space.cpp.o
[ 15%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Statement.cpp.o
[ 16%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/StrEnt.cpp.o
[ 16%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Type.cpp.o
[ 16%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Value.cpp.o
[ 17%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Value/Add.cpp.o
[ 17%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Value/And.cpp.o
[ 17%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Value/Cast.cpp.o
[ 18%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Value/Cmp.cpp.o
[ 18%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Value/Div.cpp.o
[ 18%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Value/Mod.cpp.o
[ 18%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Value/Mul.cpp.o
[ 19%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Value/OrI.cpp.o
[ 19%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Value/OrX.cpp.o
[ 19%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Value/ShL.cpp.o
[ 20%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Value/ShR.cpp.o
[ 20%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Value/Sub.cpp.o
[ 20%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Value/Unary.cpp.o
[ 21%] Linking CXX shared library libgdcc-ir-lib.dylib
[ 21%] Built target gdcc-ir-lib
Scanning dependencies of target gdcc-sr-lib
[ 22%] Building CXX object src/SR/CMakeFiles/gdcc-sr-lib.dir/Arg.cpp.o
[ 22%] Building CXX object src/SR/CMakeFiles/gdcc-sr-lib.dir/Attribute.cpp.o
[ 22%] Building CXX object src/SR/CMakeFiles/gdcc-sr-lib.dir/Exp.cpp.o
[ 23%] Building CXX object src/SR/CMakeFiles/gdcc-sr-lib.dir/Exp/Arg.cpp.o
[ 23%] Building CXX object src/SR/CMakeFiles/gdcc-sr-lib.dir/Exp/Arith.cpp.o
[ 23%] Building CXX object src/SR/CMakeFiles/gdcc-sr-lib.dir/Exp/Binary.cpp.o
[ 23%] Building CXX object src/SR/CMakeFiles/gdcc-sr-lib.dir/Exp/Bitwise.cpp.o
[ 24%] Building CXX object src/SR/CMakeFiles/gdcc-sr-lib.dir/Exp/Cmp.cpp.o
[ 24%] Building CXX object src/SR/CMakeFiles/gdcc-sr-lib.dir/Exp/Cnd.cpp.o
[ 24%] Building CXX object src/SR/CMakeFiles/gdcc-sr-lib.dir/Exp/Convert.cpp.o
[ 25%] Building CXX object src/SR/CMakeFiles/gdcc-sr-lib.dir/Exp/Defer.cpp.o
[ 25%] Building CXX object src/SR/CMakeFiles/gdcc-sr-lib.dir/Exp/IRExp.cpp.o
[ 25%] Building CXX object src/SR/CMakeFiles/gdcc-sr-lib.dir/Exp/Logical.cpp.o
[ 26%] Building CXX object src/SR/CMakeFiles/gdcc-sr-lib.dir/Exp/MulSize.cpp.o
[ 26%] Building CXX object src/SR/CMakeFiles/gdcc-sr-lib.dir/Exp/Unary.cpp.o
[ 26%] Building CXX object src/SR/CMakeFiles/gdcc-sr-lib.dir/Function.cpp.o
[ 27%] Building CXX object src/SR/CMakeFiles/gdcc-sr-lib.dir/GenStmnt/ArithEq.cpp.o
[ 27%] Building CXX object src/SR/CMakeFiles/gdcc-sr-lib.dir/GenStmnt/Convert.cpp.o
[ 27%] Building CXX object src/SR/CMakeFiles/gdcc-sr-lib.dir/GenStmnt/Move.cpp.o
[ 28%] Building CXX object src/SR/CMakeFiles/gdcc-sr-lib.dir/GenStmnt/Point.cpp.o
[ 28%] Building CXX object src/SR/CMakeFiles/gdcc-sr-lib.dir/Object.cpp.o
[ 28%] Building CXX object src/SR/CMakeFiles/gdcc-sr-lib.dir/Space.cpp.o
[ 28%] Building CXX object src/SR/CMakeFiles/gdcc-sr-lib.dir/Statement.cpp.o
[ 29%] Building CXX object src/SR/CMakeFiles/gdcc-sr-lib.dir/Statement/Empty.cpp.o
[ 29%] Building CXX object src/SR/CMakeFiles/gdcc-sr-lib.dir/Statement/Exp.cpp.o
[ 29%] Building CXX object src/SR/CMakeFiles/gdcc-sr-lib.dir/Statement/Multi.cpp.o
[ 30%] Building CXX object src/SR/CMakeFiles/gdcc-sr-lib.dir/Temporary.cpp.o
[ 30%] Building CXX object src/SR/CMakeFiles/gdcc-sr-lib.dir/Type.cpp.o
[ 30%] Building CXX object src/SR/CMakeFiles/gdcc-sr-lib.dir/Type/Array.cpp.o
[ 31%] Building CXX object src/SR/CMakeFiles/gdcc-sr-lib.dir/Type/Bitfield.cpp.o
[ 31%] Building CXX object src/SR/CMakeFiles/gdcc-sr-lib.dir/Type/Function.cpp.o
[ 31%] Building CXX object src/SR/CMakeFiles/gdcc-sr-lib.dir/Type/Pointer.cpp.o
[ 32%] Building CXX object src/SR/CMakeFiles/gdcc-sr-lib.dir/Type/Primary.cpp.o
[ 32%] Building CXX object src/SR/CMakeFiles/gdcc-sr-lib.dir/Type/Wrapper.cpp.o
[ 32%] Building CXX object src/SR/CMakeFiles/gdcc-sr-lib.dir/Warning.cpp.o
[ 33%] Linking CXX shared library libgdcc-sr-lib.dylib
[ 33%] Built target gdcc-sr-lib
Scanning dependencies of target gdcc-as-lib
[ 34%] Building CXX object src/AS/CMakeFiles/gdcc-as-lib.dir/IStream.cpp.o
[ 34%] Building CXX object src/AS/CMakeFiles/gdcc-as-lib.dir/LabelTBuf.cpp.o
[ 34%] Building CXX object src/AS/CMakeFiles/gdcc-as-lib.dir/Macro.cpp.o
[ 34%] Building CXX object src/AS/CMakeFiles/gdcc-as-lib.dir/Parse.cpp.o
[ 35%] Building CXX object src/AS/CMakeFiles/gdcc-as-lib.dir/Parse/Arg.cpp.o
[ 35%] Building CXX object src/AS/CMakeFiles/gdcc-as-lib.dir/Parse/Block.cpp.o
[ 35%] Building CXX object src/AS/CMakeFiles/gdcc-as-lib.dir/Parse/DJump.cpp.o
[ 36%] Building CXX object src/AS/CMakeFiles/gdcc-as-lib.dir/Parse/Declaration.cpp.o
[ 36%] Building CXX object src/AS/CMakeFiles/gdcc-as-lib.dir/Parse/Exp.cpp.o
[ 36%] Building CXX object src/AS/CMakeFiles/gdcc-as-lib.dir/Parse/Function.cpp.o
[ 37%] Building CXX object src/AS/CMakeFiles/gdcc-as-lib.dir/Parse/Glyph.cpp.o
[ 37%] Building CXX object src/AS/CMakeFiles/gdcc-as-lib.dir/Parse/Import.cpp.o
[ 37%] Building CXX object src/AS/CMakeFiles/gdcc-as-lib.dir/Parse/Object.cpp.o
[ 38%] Building CXX object src/AS/CMakeFiles/gdcc-as-lib.dir/Parse/Space.cpp.o
[ 38%] Building CXX object src/AS/CMakeFiles/gdcc-as-lib.dir/Parse/StrEnt.cpp.o
[ 38%] Building CXX object src/AS/CMakeFiles/gdcc-as-lib.dir/Parse/Type.cpp.o
[ 39%] Building CXX object src/AS/CMakeFiles/gdcc-as-lib.dir/Parse/Value.cpp.o
[ 39%] Building CXX object src/AS/CMakeFiles/gdcc-as-lib.dir/ParseFile.cpp.o
[ 39%] Linking CXX shared library libgdcc-as-lib.dylib
[ 39%] Built target gdcc-as-lib
Scanning dependencies of target gdcc-cpp-lib
[ 39%] Building CXX object src/CPP/CMakeFiles/gdcc-cpp-lib.dir/ConcatTBuf.cpp.o
[ 40%] Building CXX object src/CPP/CMakeFiles/gdcc-cpp-lib.dir/ConditionDTBuf.cpp.o
[ 40%] Building CXX object src/CPP/CMakeFiles/gdcc-cpp-lib.dir/DirectiveTBuf.cpp.o
[ 40%] Building CXX object src/CPP/CMakeFiles/gdcc-cpp-lib.dir/GetExpIR.cpp.o
[ 41%] Building CXX object src/CPP/CMakeFiles/gdcc-cpp-lib.dir/IStream.cpp.o
[ 41%] Building CXX object src/CPP/CMakeFiles/gdcc-cpp-lib.dir/IncludeDTBuf.cpp.o
[ 41%] Building CXX object src/CPP/CMakeFiles/gdcc-cpp-lib.dir/Macro.cpp.o
[ 42%] Building CXX object src/CPP/CMakeFiles/gdcc-cpp-lib.dir/MacroDTBuf.cpp.o
[ 42%] Building CXX object src/CPP/CMakeFiles/gdcc-cpp-lib.dir/MacroTBuf.cpp.o
[ 42%] Building CXX object src/CPP/CMakeFiles/gdcc-cpp-lib.dir/PPTokenTBuf.cpp.o
[ 43%] Building CXX object src/CPP/CMakeFiles/gdcc-cpp-lib.dir/Pragma.cpp.o
/Users/a/Desktop/GDCC-master/src/CPP/Pragma.cpp:110:30: error: no member named 'emplace_back' in 'std::__1::vector<bool,
      std::__1::allocator<bool> >'
         stackCXLimitedRange.emplace_back(stateCXLimitedRange);
         ~~~~~~~~~~~~~~~~~~~ ^
/Users/a/Desktop/GDCC-master/src/CPP/Pragma.cpp:111:30: error: no member named 'emplace_back' in 'std::__1::vector<bool,
      std::__1::allocator<bool> >'
         stackFEnvAccess    .emplace_back(stateFEnvAccess);
         ~~~~~~~~~~~~~~~     ^
/Users/a/Desktop/GDCC-master/src/CPP/Pragma.cpp:112:30: error: no member named 'emplace_back' in 'std::__1::vector<bool,
      std::__1::allocator<bool> >'
         stackFPContract    .emplace_back(stateFPContract);
         ~~~~~~~~~~~~~~~     ^
/Users/a/Desktop/GDCC-master/src/CPP/Pragma.cpp:113:30: error: no member named 'emplace_back' in 'std::__1::vector<bool,
      std::__1::allocator<bool> >'
         stackFixedLiteral  .emplace_back(stateFixedLiteral);
         ~~~~~~~~~~~~~~~~~   ^
/Users/a/Desktop/GDCC-master/src/CPP/Pragma.cpp:114:30: error: no member named 'emplace_back' in 'std::__1::vector<bool,
      std::__1::allocator<bool> >'
         stackStrEntLiteral .emplace_back(stateStrEntLiteral);
         ~~~~~~~~~~~~~~~~~~  ^
5 errors generated.
make[2]: *** [src/CPP/CMakeFiles/gdcc-cpp-lib.dir/Pragma.cpp.o] Error 1
make[1]: *** [src/CPP/CMakeFiles/gdcc-cpp-lib.dir/all] Error 2
make: *** [all] Error 2
a@Droid-Pro:~/Desktop/GDCC-master/build$
bitshifter
 
Joined: 13 Jan 2017

Re: GDCC: An Alternative ACS Compiler

Postby PlutonicOverkill » Sat Jan 14, 2017 1:52 am

Hi, just reporting a possible bug/limitation: if you try to access a member of a struct returned from a function, gdcc-cc gives the error "invalid member". The following program compiles and runs fine on every C compiler I've tested it on, but it fails to compile with gdcc:
Code: Select allExpand view
#include <stdio.h>

struct Foo {
   int bar;
};

struct Foo create_foo()
{
   return (struct Foo){42};
}

int main()
{
   int foobar = create_foo().bar; // this gives an error
   printf("%d", foobar);
   return 0;
}

Is this a known problem? It would be great if this could be fixed as it would allow for fewer local variables/generally neater code.
PlutonicOverkill
 
Joined: 25 Jul 2016

Re: GDCC: An Alternative ACS Compiler

Postby DavidPH » Sat Jan 14, 2017 10:44 am

@Nash Do not use the BC_DGE builds. That branch does not keep up with ZDoom updates (except when merging in master for other reasons).

@bitshifter Hopefully the latest commit fixes that. I actually had no idea std::vector<bool> did not have emplace_back until C++14. I'd be interested to know what the error on BC_DGE branch was, though, as that branch is using C++17.

@PlutonicOverkill That is a known limitation, currently. Member access and subscripting of rvalues is a needed feature (they are valid since C99, and just plain useful as you said), but I have not gotten to them, yet.
User avatar
DavidPH
Crazy Compiler Man
 
Joined: 28 Aug 2009

Re: GDCC: An Alternative ACS Compiler

Postby bitshifter » Sat Jan 14, 2017 2:30 pm

I'd recommend not to use c++17 yet due to portability issues or if absolutely necessary. The c++14 support on the most recent gcc version should be checked that everything used is supported. Also, I'm unsure how to configure cmake to use gcc instead of llvm. Will check on that again when I can...
bitshifter
 
Joined: 13 Jan 2017

Re: GDCC: An Alternative ACS Compiler

Postby Nash » Sat Jan 14, 2017 3:21 pm

So which builds should I use? I only download from https://www.dropbox.com/sh/e4msp35vxp61 ... oElWa?dl=0
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: GDCC: An Alternative ACS Compiler

Postby bitshifter » Sat Jan 14, 2017 4:17 pm

@DavidPH - Downloaded newest master, and tried to compile with GCC 6.1.0. Still cannot compile due to linking errors... Thanks.

Code: Select allExpand view
-- The C compiler identification is GNU 6.1.0
-- The CXX compiler identification is GNU 6.1.0
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Check for working C compiler: /usr/local/bin/gcc-6
-- Check for working C compiler: /usr/local/bin/gcc-6 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Check for working CXX compiler: /usr/local/bin/g++-6
-- Check for working CXX compiler: /usr/local/bin/g++-6 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test GDCC_FLAG_CXX_Wall
-- Performing Test GDCC_FLAG_CXX_Wall - Success
-- Performing Test GDCC_FLAG_CXX_Wextra
-- Performing Test GDCC_FLAG_CXX_Wextra - Success
-- Performing Test GDCC_FLAG_CXX_Wpedantic
-- Performing Test GDCC_FLAG_CXX_Wpedantic - Success
-- Performing Test GDCC_FLAG_CXX_Wshadow
-- Performing Test GDCC_FLAG_CXX_Wshadow - Success
-- Performing Test GDCC_FLAG_CXX_Wno_misleading_indentation
-- Performing Test GDCC_FLAG_CXX_Wno_misleading_indentation - Success
-- Performing Test GDCC_FLAG_CXX_CXX11
-- Performing Test GDCC_FLAG_CXX_CXX11 - Success
-- Found GMP: /usr/local/lib/libgmp.dylib;/usr/local/lib/libgmpxx.dylib 
-- Configuring done
CMake Warning (dev):
  Policy CMP0042 is not set: MACOSX_RPATH is enabled by default.  Run "cmake
  --help-policy CMP0042" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  MACOSX_RPATH is not specified for the following targets:

   gdcc-acc-lib
   gdcc-ar-lib
   gdcc-ar-wad-lib
   gdcc-as-lib
   gdcc-bc-lib
   gdcc-bc-mgc-lib
   gdcc-bc-zdacs-lib
   gdcc-cc-lib
   gdcc-core-lib
   gdcc-cpp-lib
   gdcc-ir-lib
   gdcc-ld-lib
   gdcc-ntsc-lib
   gdcc-option-lib
   gdcc-platform-lib
   gdcc-sr-lib

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /Users/a/Desktop/GDCC-master/build
a@Droid-Pro:~/Desktop/GDCC-master/build$ make
Scanning dependencies of target gdcc-option-lib
[  0%] Building CXX object src/Option/CMakeFiles/gdcc-option-lib.dir/Base.cpp.o
[  0%] Building CXX object src/Option/CMakeFiles/gdcc-option-lib.dir/CStr.cpp.o
[  0%] Building CXX object src/Option/CMakeFiles/gdcc-option-lib.dir/CStrV.cpp.o
[  1%] Building CXX object src/Option/CMakeFiles/gdcc-option-lib.dir/Exception.cpp.o
[  1%] Building CXX object src/Option/CMakeFiles/gdcc-option-lib.dir/Program.cpp.o
[  1%] Building CXX object src/Option/CMakeFiles/gdcc-option-lib.dir/Program/Process.cpp.o
[  2%] Building CXX object src/Option/CMakeFiles/gdcc-option-lib.dir/Program/Put.cpp.o
[  2%] Building CXX object src/Option/CMakeFiles/gdcc-option-lib.dir/StrUtil.cpp.o
[  2%] Linking CXX shared library libgdcc-option-lib.dylib
[  2%] Built target gdcc-option-lib
Scanning dependencies of target gdcc-core-lib
[  2%] Building CXX object src/Core/CMakeFiles/gdcc-core-lib.dir/BinaryIO.cpp.o
[  2%] Building CXX object src/Core/CMakeFiles/gdcc-core-lib.dir/Counter.cpp.o
[  3%] Building CXX object src/Core/CMakeFiles/gdcc-core-lib.dir/Dir.cpp.o
[  3%] Building CXX object src/Core/CMakeFiles/gdcc-core-lib.dir/Exception.cpp.o
[  3%] Building CXX object src/Core/CMakeFiles/gdcc-core-lib.dir/File.cpp.o
[  3%] Building CXX object src/Core/CMakeFiles/gdcc-core-lib.dir/Number.cpp.o
[  4%] Building CXX object src/Core/CMakeFiles/gdcc-core-lib.dir/Option.cpp.o
[  4%] Building CXX object src/Core/CMakeFiles/gdcc-core-lib.dir/Origin.cpp.o
[  4%] Building CXX object src/Core/CMakeFiles/gdcc-core-lib.dir/ParseNumber.cpp.o
[  5%] Building CXX object src/Core/CMakeFiles/gdcc-core-lib.dir/ParseString.cpp.o
[  5%] Building CXX object src/Core/CMakeFiles/gdcc-core-lib.dir/Path.cpp.o
[  5%] Building CXX object src/Core/CMakeFiles/gdcc-core-lib.dir/String.cpp.o
[  6%] Building CXX object src/Core/CMakeFiles/gdcc-core-lib.dir/StringGen.cpp.o
[  6%] Building CXX object src/Core/CMakeFiles/gdcc-core-lib.dir/StringOption.cpp.o
[  6%] Building CXX object src/Core/CMakeFiles/gdcc-core-lib.dir/Warning.cpp.o
[  7%] Linking CXX shared library libgdcc-core-lib.dylib
[  7%] Built target gdcc-core-lib
Scanning dependencies of target gdcc-platform-lib
[  8%] Building CXX object src/Platform/CMakeFiles/gdcc-platform-lib.dir/Alloc.cpp.o
[  8%] Building CXX object src/Platform/CMakeFiles/gdcc-platform-lib.dir/Platform.cpp.o
[  8%] Linking CXX shared library libgdcc-platform-lib.dylib
[  8%] Built target gdcc-platform-lib
Scanning dependencies of target gdcc-ir-lib
[  8%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Addr.cpp.o
[  8%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Arg.cpp.o
[  8%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Block.cpp.o
[  9%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/CallType.cpp.o
[  9%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Code.cpp.o
[  9%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/DJump.cpp.o
[ 10%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Exp.cpp.o
[ 10%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Exp/Binary.cpp.o
[ 10%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Exp/Branch.cpp.o
[ 11%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Exp/Glyph.cpp.o
[ 11%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Exp/Multi.cpp.o
[ 11%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Exp/Unary.cpp.o
[ 12%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Exp/Value.cpp.o
[ 12%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Function.cpp.o
[ 12%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Glyph.cpp.o
[ 13%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/IArchive.cpp.o
[ 13%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Import.cpp.o
[ 13%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Linkage.cpp.o
[ 13%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/OArchive.cpp.o
[ 14%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Object.cpp.o
[ 14%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/OpCode.cpp.o
[ 14%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Program.cpp.o
[ 15%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/ScriptType.cpp.o
[ 15%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Space.cpp.o
[ 15%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Statement.cpp.o
[ 16%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/StrEnt.cpp.o
[ 16%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Type.cpp.o
[ 16%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Value.cpp.o
[ 17%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Value/Add.cpp.o
[ 17%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Value/And.cpp.o
[ 17%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Value/Cast.cpp.o
[ 18%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Value/Cmp.cpp.o
[ 18%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Value/Div.cpp.o
[ 18%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Value/Mod.cpp.o
[ 18%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Value/Mul.cpp.o
[ 19%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Value/OrI.cpp.o
[ 19%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Value/OrX.cpp.o
[ 19%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Value/ShL.cpp.o
[ 20%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Value/ShR.cpp.o
[ 20%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Value/Sub.cpp.o
[ 20%] Building CXX object src/IR/CMakeFiles/gdcc-ir-lib.dir/Value/Unary.cpp.o
[ 21%] Linking CXX shared library libgdcc-ir-lib.dylib
Undefined symbols for architecture x86_64:
  "operator<<(std::basic_ostream<char, std::char_traits<char> >&, __mpf_struct const*)", referenced from:
      std::basic_ostream<char, std::char_traits<char> >& operator<< <__mpf_struct [1], __mpf_struct [1]>(std::basic_ostream<char, std::char_traits<char> >&, __gmp_expr<__mpf_struct [1], __mpf_struct [1]> const&) in Value.cpp.o
  "operator<<(std::basic_ostream<char, std::char_traits<char> >&, __mpz_struct const*)", referenced from:
      std::basic_ostream<char, std::char_traits<char> >& operator<< <__mpz_struct [1], __mpz_struct [1]>(std::basic_ostream<char, std::char_traits<char> >&, __gmp_expr<__mpz_struct [1], __mpz_struct [1]> const&) in Value.cpp.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[2]: *** [src/IR/libgdcc-ir-lib.dylib] Error 1
make[1]: *** [src/IR/CMakeFiles/gdcc-ir-lib.dir/all] Error 2
make: *** [all] Error 2
bitshifter
 
Joined: 13 Jan 2017

Re: GDCC: An Alternative ACS Compiler

Postby DavidPH » Sun Jan 15, 2017 10:00 am

@Nash The ones not marked with BC_DGE, just gdcc_vXXX.
User avatar
DavidPH
Crazy Compiler Man
 
Joined: 28 Aug 2009

Re: GDCC: An Alternative ACS Compiler

Postby Nash » Wed Jan 18, 2017 11:40 am

These GZDoom exclusive functions are missing from gdcc-acc https://github.com/rheit/acc/commit/794 ... 1161422091
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: GDCC: An Alternative ACS Compiler

Postby DavidPH » Wed Jan 25, 2017 1:28 pm

@Nash Added. Also added implicit conversion from line specials to int to the ACS front, so you can pass them to SetLineSpecial as in acc.

@bitshifter Sorry about taking so long to get back to you. Been a bad combination of lack of time and needing to find a Mac developer to help diagnose the problem. (In so far as the function it's looking for does exist, the linker error confuses me.)
User avatar
DavidPH
Crazy Compiler Man
 
Joined: 28 Aug 2009

Re: GDCC: An Alternative ACS Compiler

Postby Graf Zahl » Wed Jan 25, 2017 1:36 pm

In case nobody hasn't told you: Latent functions like Delay, Scriptwait or Tagwait are bad for ACS functions. Here's a link to what can happen:

https://mantis.zdoom.org/view.php?id=112

ACC complains when trying to use them there but GDCC lets them pass.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: GDCC: An Alternative ACS Compiler

Postby Gez » Wed Jan 25, 2017 3:30 pm

GDCC lets them pass because the Eternity ACS VM handles them.
Gez
 
 
 
Joined: 06 Jul 2007

Re: GDCC: An Alternative ACS Compiler

Postby DavidPH » Fri Jan 27, 2017 9:21 am

I have thought about how to add a warning for delays or potential delays when targeting ZDoom. The issue is mostly syntactic. Since GDCC has no special knowledge of any of those functions, it relies entirely on the header declaration to know about such properties. And I have not yet decided on a syntax for attributes in the ACS front, which would be the most relevant for such a warning.

To be honest, though, it is mostly a lack of priority for such a warning. I had been under the impression that it was well known that ZDoom does not preserve ACS stack information through delays. (Or at least that you cannot use delays in ordinary functions.)
User avatar
DavidPH
Crazy Compiler Man
 
Joined: 28 Aug 2009

Re: GDCC: An Alternative ACS Compiler

Postby Nero » Sat Feb 04, 2017 11:24 pm

So quick question: are recursive functions possible? I've tried three times now to implement something with recursion and either the game crashes, or the code does.

My third attempt is just a simple recursion test:
Code: Select allExpand view
bool recursionTest (int loop)
{
   if (loop == 5)
      return true;
   else
      return (recursionTest(loop++));
}

// main calls recursionTest(0);


I get "out of stack space in _main".
User avatar
Nero
Royal Boredom....Why can't I do this in Windows?
 
Joined: 06 Sep 2006
Location: Middle of Nowheresville Il.

PreviousNext

Return to Editors / Asset Manipulation

Who is online

Users browsing this forum: No registered users and 1 guest