Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • sac2c sac2c
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 403
    • Issues 403
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 11
    • Merge requests 11
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Issues
  • #2530
Closed
Open
Created Jan 28, 2026 by Sven-Bodo Scholz@sbsOwner

bug in code generation for -check c

When compiling:

use Array: all;

// imports


// typedefs


// functions
double [m,p] matmul( double[m,n] a, double[n,p] b)
{
    return {[i,j] -> sum ({[k] -> a[i,k] * b[k,j]}) };
}

int main () {
    a = genarray( [10,10], 1.0);
    StdIO::print (matmul( a, a));
    return 0;
}

with sac2c -check c we get

/Users/sbs/Dropbox/BodoSac/error/a.out.c:1462:403: error: expected ')'
 1462 |     if (SACp_emal_8968__flat_7 < SACp_emal_8963__uprf_4320) { SACp_emal_8962__uprf_4322 = 1; } else { SACp_emal_8962__uprf_4322 = 0; SAC_RuntimeWarningLoc ("//Users/sbs/sacbase/Stdlib/build/src-seq/structures/ArrayBasics.sac", 12, 1665, "Scalar constraint `" "%s (" "%" "ll" "d" ") < " "%s (" "%" "ll" "d" ")" "' violated", "SACp_emal_8968__flat_7", SACp_emal_8968__flat_7, "SACp_emal_8963__uprf_4320" SACp_emal_8963__uprf_4320); }
      |                                                                                                                                                                                                                                                                                                                                                                                                                   ^
/Users/sbs/Dropbox/BodoSac/error/a.out.c:1462:156: note: to match this '('
 1462 |     if (SACp_emal_8968__flat_7 < SACp_emal_8963__uprf_4320) { SACp_emal_8962__uprf_4322 = 1; } else { SACp_emal_8962__uprf_4322 = 0; SAC_RuntimeWarningLoc ("//Users/sbs/sacbase/Stdlib/build/src-seq/structures/ArrayBasics.sac", 12, 1665, "Scalar constraint `" "%s (" "%" "ll" "d" ") < " "%s (" "%" "ll" "d" ")" "' violated", "SACp_emal_8968__flat_7", SACp_emal_8968__flat_7, "SACp_emal_8963__uprf_4320" SACp_emal_8963__uprf_4320); }
      |                                                                                                                                                            ^
...
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking