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 402
    • Issues 402
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 13
    • Merge requests 13
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Issues
  • #1670
Closed
Open
Created Jan 26, 2006 by Stephan Herhut@sahGuest

conceptual problem with ... return values

Bugzilla Link 197
Created on Jan 26, 2006 13:26
Resolution FIXED
Resolved on Jan 27, 2006 14:49
Version 1.00beta
OS Linux
Architecture PC

Extended Description

Compiling module ScalarIO lead to the following error message:
ABORT: line 643  file: ScalarIO.sac
ABORT: Cannot infer type of "result" as it corresponds to "..." return type
ABORT: -- missing type declaration
This is due to the fact that the source code of function scanchar, which
includes a declaration for the type of result, is transformed in phase 5. The
original code looks like:
inline bool, char scanchar()
{
  char result;
  success, result=TermFile::scanf("%c");
  return(success==1, result);
}
After transformation we get:
inline
#189: in [ --, Terminal::Terminal] le <> ge <>, #190: in [ --,
TermFile::TermFile] le <> ge <>, #191: in [ --, bool[*]] le <> ge <>, #192: in [
--, char[*]] le <> ge <> ScalarIO::scanchar( Terminal::Terminal
_rso_322_TheTerminal, TermFile::TermFile _rso_321_stdin)
/*
 *  scanchar ::  ---
 */
{
  unknown[*] _flat_9__SSA0_1; /* (null) */
  unknown[*] result__SSA0_2; /* (null) */
  unknown[*] result__SSA0_1; /* (null) */
  unknown[*] _rso_321_stdin__SSA0_1; /* (null) */
  unknown[*] _rso_322_TheTerminal__SSA0_1; /* (null) */
  unknown[*] _flat_9; /* (null) */
  unknown[*] _flat_10; /* (null) */
  unknown[*] success; /* (null) */
  unknown[*] _flat_6; /* (null) */
  unknown[*] _flat_7; /* (null) */
  unknown[*] _flat_8; /* (null) */
  unknown[*] result; /* (null) */
  _flat_8 = 2;
  _flat_7 = [ '%', 'c', '\0' ];
  _flat_6 = wrapper:String::to_string( _flat_7, _flat_8);
  _rso_322_TheTerminal__SSA0_1, _rso_321_stdin__SSA0_1, success, result =
wrapper:TermFile::scanf( _rso_322_TheTerminal, _rso_321_stdin, _flat_6);
  result__SSA0_1 = type_conv( char, result);
  _flat_10 = 1;
  _flat_9 = wrapper:ScalarArith::==( success, _flat_10);
  result__SSA0_2 = type_conv( char, result__SSA0_1);
  _flat_9__SSA0_1 = type_conv( bool, _flat_9);
  return( _rso_322_TheTerminal__SSA0_1, _rso_321_stdin__SSA0_1, _flat_9__SSA0_1,
result__SSA0_2);
}
The original declaration has thus been transformed into a type_conv. This leads
to the given error message, as no declared type is available for result...
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking