stonier / ecl_core

A set of tools and interfaces extending the capabilities of c++ to provide a lightweight, consistent interface with a focus for control programming.
Other
84 stars 69 forks source link

ecl_debug_catch fails in release #7

Closed stonier closed 4 years ago

stonier commented 11 years ago
ecl_debug_try {
    // something
ecl_debug_catch(Exception &e) { 
    std::cout << e.what() << std::endl;
}

is broken in release mode because it doesn't know what e is.

stonier commented 10 years ago

This is used liberally through the ycs. Should come up with a solution for it.

bit-pirate commented 10 years ago

The two cases I found are related with data writes on a "ecl::Serialorftdi::Ftdi` instance and look like this:

ecl::Error PacketHandler::writeData(unsigned char *buff, unsigned long size_buff)
{
  ecl::Error error = ecl::NoError;
  if (device != NULL)
  {
    ecl_debug_try
    {
      if (device->write(buff, size_buff) == -1)
      {
        error = device->error(); // release mode and there is no exceptions, we land here.
      }
    }
    ecl_debug_catch (const ecl::StandardException &e){
      error = e.flag();
    }
  }
  else
  {
    error = ecl::NotInitialisedError;
  }
  return error;
}

I guess, it would be okay to just remove the exception handling until this gets properly fixed. Thoughts?

stonier commented 10 years ago

Sounds good to me - I still can't think of a way around this.

clalancette commented 4 years ago

@stonier For what it is worth, I just built all of ecl stuff locally in Release mode, and everything seems to work here. So we might consider closing this very old bug.

stonier commented 4 years ago

Oh, that's interesting. I should leave bugs open more often, let the world fix my problems :)