coriolis icon indicating copy to clipboard operation
coriolis copied to clipboard

Fix usage of getcwd

Open robtaylor opened this issue 2 years ago • 2 comments

../../hurricane/src/viewer/CellViewer.cpp:893:12: warning: ignoring return value of ‘char* getcwd(char*, size_t)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  893 |     getcwd ( workingDirectory, 1024 );
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~

should probably use modern getcwd that allocates the right length buffer. But why is this being used?!

robtaylor avatar Oct 13 '23 19:10 robtaylor

Other places its being used: lefdef - probably ok to leave crlcore/python/helpers/init.py bora/python/initHook.py bootstrap/socInstaller.py hurricane/src/utilities/Path.cpp

robtaylor avatar Oct 14 '23 12:10 robtaylor

For CellViewer, the name of the function it is in gives a clue : CellViewer::imageDisplay(). We get the cwd to save the image (PNG or whatever) in it.

  • lefdef : we don't touch unless it really cause a problem.
  • ignore what's in bootstrap it's for developers only. Maybe deprecated, not a priority anyway.
  • In crlcore, it is part of the early initialization process and likely could be removed.
  • In katana/python/initHook.py, I wonder how it can be removed, as it is to look inside the currently running directory for user-defined, on the fly, python patchs (typically: configure debugging).

jpc-lip6 avatar Oct 14 '23 13:10 jpc-lip6