Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • T titan.core
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 45
    • Issues 45
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Eclipse Projects
  • Eclipse Titan
  • titan.core
  • Issues
  • #580

Closed
Open
Created Dec 21, 2021 by Gábor Szalai@gszalaiMaintainer

gcc warning: control reaches end of non-void function

Summary

The GCC compiler generates a warning: warning: control reaches end of non-void function [-Wreturn-type]

Steps and/or TTCN-3 code to reproduce

module proba{

type enumerated t_e {I,O} 
  
function f1(in t_e a) return integer {
  select(a){
    case (I) {
      return 1
    }
    case else {
      return 2
    }
  }
  
  
}
  
  
}

What is the current bug behavior?

g++  -c -DLINUX -I/home/ethgasz/TTCNv3/include  -Wall   -o proba.o proba.cc
proba.cc: In function ‘INTEGER proba::f1(const proba::t__e&)’:
proba.cc:665:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^

What is the expected correct behavior?

No warning

Possible fixes

Do not generate the unnecessary goto and label statements

/cc @aknappqwt

Assignee
Assign to
Time tracking

Copyright © Eclipse Foundation, Inc. All Rights Reserved.     Privacy Policy | Terms of Use | Copyright Agent