diff --git a/gcc/cobol/cdf-copy.cc b/gcc/cobol/cdf-copy.cc index 102dac6a043d41154ad8c67ce1f019fa72e28bc1..5187e940f7822ee399e4f238fe0ef97a99e47360 100644 --- a/gcc/cobol/cdf-copy.cc +++ b/gcc/cobol/cdf-copy.cc @@ -28,8 +28,15 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +// NOTE: Unlike charmaps-copy.cc and valprint-copy.cc, this file implements +// the Compiler Directives Facility for the COBOL "COPY" statement. So, this +// file is the actual source code, and not a copy of something in libgcobol +// +// We regret any confusion engendered. + #include "lexio.h" #include "copybook.h" +#include "util.h" #include <deque> @@ -168,7 +175,7 @@ esc( size_t len, const char input[] ) { *p = '\0'; #if 0 - warnx("%s:%d: regex '%s'", __func__, __LINE__, buffer); + cbl_warning("%s:%d: regex '%s'", __func__, __LINE__, buffer); #endif return strdup(buffer); } @@ -293,7 +300,7 @@ copybook_elem_t::open_file( const char directory[], bool literally ) { if( literally ) { if( yydebug ) { - warnx("copybook_elem_t::open_file: trying %s", path); + cbl_warning("copybook_elem_t::open_file: trying %s", path); } if( (this->fd = open(path, O_RDONLY)) == -1 ) { @@ -330,13 +337,13 @@ copybook_elem_t::open_file( const char directory[], bool literally ) { if( (erc = glob(pattern, flags, glob_error, &globber)) != 0 ) { switch(erc) { case GLOB_NOSPACE: - warnx("COPY file search: out of memory"); + cbl_warning("COPY file search: out of memory"); break; case GLOB_ABORTED: - warnx("COPY file search: read error"); + cbl_warning("COPY file search: read error"); break; case GLOB_NOMATCH: - if( yydebug) warnx("COPY '%s': no files match %s", this->source, pattern); + if( yydebug) cbl_warning("COPY '%s': no files match %s", this->source, pattern); default: break; // caller says no file found } @@ -349,7 +356,7 @@ copybook_elem_t::open_file( const char directory[], bool literally ) { auto filename = globber.gl_pathv[i]; if( (this->fd = open(filename, O_RDONLY)) != -1 ) { if( yydebug ) { - warnx("found copybook file %s", filename); + cbl_warning("found copybook file %s", filename); } this->source = strdup(filename); if( ! this->source ) {