Thread: C# Compile Time Debugging

  1. #1
    Registered User
    Join Date
    Aug 2007
    Posts
    18

    Lightbulb C# Compile Time Debugging

    I am working on a c# program but after a while it become to complex and make some adjustment now getting some error such as not all path return a value, but didnt find which function do not return value. All of my friends function works correctly when they run alone but when I put all them together it gives error
    Is there any tool show me which path do not return value? or can I make compile time debugging?if I were to see which path become a problem instead of a class.
    Thanx you in advance.

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    The error message should give you the line where the function ends. In the IDE, it should suffice to double-click it to get there.

    Once you have the function, how hard can it be? As long as your functions are of sane size (no more than, say, 100 lines), there can't be too many branches.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  3. #3
    Registered User
    Join Date
    Aug 2007
    Posts
    18
    My function unfortunately due to our bad programming practices include more than 100 thousands lines of code. Is there any way to see exactly which function ddo not return a value?

  4. #4
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    The function is obvious. But there is AFAIK no way to know which path doesn't return a value.

    You have one function that is 100000s of lines long? Oh dear.

    Look, that's just a hopeless situation. What you have to do is split the function up into parts. Then you can reduce the region where the error occurs.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Doesn't just double clicking on the error message take you to the line / function in question?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Using sizeof( long ) at compile time?
    By cpjust in forum C Programming
    Replies: 16
    Last Post: 11-14-2007, 01:22 PM
  2. Bugging ... Compile Time Error
    By keats in forum C Programming
    Replies: 7
    Last Post: 03-25-2007, 04:54 AM
  3. Compile time error
    By j_spinto in forum C Programming
    Replies: 31
    Last Post: 05-06-2005, 10:41 AM
  4. Replies: 0
    Last Post: 11-29-2002, 10:24 PM
  5. Debugging mode selection during compile time
    By YALINI in forum C Programming
    Replies: 1
    Last Post: 09-03-2001, 09:56 AM