Skip to content

Poor encapsulation in fread/fwrite headers #6468

@MichaelChirico

Description

@MichaelChirico

Related to #6466. Note the current compiler warnings:

freadR.h:24:13: warning: ‘internal_error_buff’ defined but not used [-Wunused-variable]
   24 | static char internal_error_buff[1001]; // match internalErrSize
      |             ^~~~~~~~~~~~~~~~~~~
In file included from fwriteR.c:3:
fwrite.h:12:15: warning: ‘internal_error_buff’ defined but not used [-Wunused-variable]
   12 |   static char internal_error_buff[256];
      |               ^~~~~~~~~~~~~~~~~~~

For fwrite.h, the issue is INTERNAL_STOP() is never used in fwriteR.c, only in fwrite.c:

INTERNAL_STOP("type %d has no max length method implemented", args.whichFun[j]); // # nocov

But fwrite.h is included in both files:

#include "fwrite.h"

IMO this is sloppy design, but it's a bit hard to unentangle -- requires a careful accounting of what's used where across the two .c files.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions