Is it possible to Upgrade a Warning to an Error?

Hi All,

Does anyone know if there is a compile pragma or something that tells the compiler to upgrade a specific warning to being an error?

I’m thinking specifically of “Unusual Type Conversion”.
I’ve not found a situation where the code under this warning will actually behave as expected (except purely by accident.)

Ideally I think this could be (optionally?) upgraded to being a straight error?

Clarion language warnings can be treated as errors only all together by setting the warn(wall) pragma to “err”. This can be done in the Project Options dialog:


, or in the source code:
PRAGMA('warn(wall=>err)')

Thanks Alexy,

Alas in this case (not my system) there are over 7000 warnings across hundreds of apps. Most are of the “harmless” variety (Label duplicated, Function called as procedure, and so on).
Ideally warnings should be 0, but these folk weren’t ruthless about that along the way, so now the warning system is (almost) useless. Which is a pity…

In the long run they need to address all of them (ideally).
In the meantime I’ll do a Copy-all, paste into notepad, and then just search for the ones I think are a problem.

I use the “err” setting for all warnings always. Some warnings are not errors really but they are subject to overview the code. If to not react to warnings during long time, some of them will lead to real problems. For example, in case of “Label duplicated” information can be stored not where it must be.

On my machine, with far fewer than 7000 warnings, it takes quite a while to select them, and sometimes it can lock up the IDE.

Do you or anybody know if the output can be directed to a file?

“Legacy” projects allow to do this easy. But the IDE uses MSBuild projects…

I’ll look the Project Manager that can be done. But, probably, it would be better to ask RZ to ship the CLAMAKE.EXE utility. It is the command line interface to the Project Manager to work with “legacy” projects. Now it is including as a part of the Driver Kit. Really, all the Win32 part of Clarion is building using CLAMAKE.

2 Likes

The PrjServer.EXE utility which is invoking to compile/link files if the “Execute the Build as a separate Process” setting is turned on (Tools->Options->IDE->Projects and Solutions), includes the logger writing information to console. I think, this output can be redirected to a file. When PrjServer is invoking from IDE, it receives all parameters from the MSBuild engine worker. If command line parameters of PrjServer are documented, it can be run “manually” from the command line.

For a while, I do not see how to redirect/copy errors/warnings messages to a file without changing the Project Manager or the code to invoke PrjServer.EXE.

Just now the IDE allows to copy messages generated during the make:

  • if errors or warnings were reported on make switch from the Errors view to Output view by placing the mouse pointer over the “Output” label:
  • Choose the Build view mode from the drop-box, if required, and press the “Select All” button:
  • Now you can copy output to the clipboard and then paste it to some file.
2 Likes

Jeff, if you use my claInterface utility to compile the APP it generates the compiler output to msbuild.log in the same folder as the solution.

Is there a Pragma to turn off this warning? Or a way to assume PROC on all functions?

I also have a situation with 1000’s of warnings. I would like to reduce the count and look into other things first, mainly duplicates.

In my situation I think the Duplicate Warnings are repeated once for each Module making for many more in the list.

Hi Rick - Does that work in non-app solutions?

No, claInterface is geared towards solutions based on APP files.
I could get you the msbuild command to run manually. Then you can run it on any cwproj file.

That would be sweet. Thank you, @Rick_UpperPark

I’ve been using info from this topic for years

1 Like

No, only together with all other warnings.

It’s not a problem to ignore/just send a message/convert to an error every particular warning separately in the compiler. Corresponding PRAGMA directives can be specified in the main program module, though it would be more correctly to use the Project Manager to set them,

warn pragmas for C/C++ do use quite cryptic denotations to handle particular warnings. I do not like this way. Some other method is required. Probably, somebody has an idea how it could be done.

Here the full list of Clarion warnings:

  • Label duplicated, second used
  • Calling function as procedure
  • Unable to verify validity of the OVER attribute
  • Redefining system intrinsic
  • Field label is duplicated, first used
  • ! introduces a comment
  • Function did not return result
  • Label not used
  • Type descriptor for nested GROUP will be wrong
  • Attribute is not valid for fields. Ignored
  • Unusual type conversion
  • Parameters must be enclosed in parentheses
  • TOOLBOX window cannot have the MDI attribute
  • Mis-use of the PRIVATE attribute. Ignored
  • Mis-use of the PROTECTED attribute. Ignored
  • Threaded variable is using in declaration of not-threaded FILE
  • Deprecated attribute
  • Ambiguous reference types

and some more are coming (probably). Unlikely all warnings listed above are need in separate control.

I added a note to the article that @CarlBarnes referenced.

1 Like