Project

General

Profile

Feature #1702

Use C++ attributes

Added by John Abbott over 1 year ago. Updated 5 days ago.

Status:
In Progress
Priority:
Low
Assignee:
-
Category:
Tidying
Target version:
Start date:
18 Oct 2022
Due date:
% Done:

10%

Estimated time:
Spent time:

Description

Since C++11 attributes are available.
These can be used to suppress compiler warnings, or give hints about likelihood
of a condition being false/true.

A list of standard attributes can be found at:

https://en.cppreference.com/w/cpp/language/attributes


Related issues

Related to CoCoALib - Design #1225: Move to C++14 (skipping C++11)In Progress2018-09-06

History

#1 Updated by John Abbott over 1 year ago

  • Related to Design #1225: Move to C++14 (skipping C++11) added

#2 Updated by John Abbott about 1 year ago

Let me clarify. I think we should try to avoid warnings by rectifying the code.
If we are sure the code is correct, but the compiler still issues warnings then
we can resort to using attributes to try to suppress the warnings.

An example could be a variable whose value is used only when debugging is active.
It is in principle possible to suppress the variable using #if CoCoA_DEBUG_MODE
this is cumbersome, and could easily make the code harder to read.

I would like to reduce the number of warnings. One easy way is to complete the
implementation of some functions which have an unused "CheckForTimeout" parameter.

#3 Updated by John Abbott 2 months ago

  • Target version changed from CoCoALib-0.99850 to CoCoALib-0.99900

#4 Updated by John Abbott 5 days ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 10

We should try to reduce the number of warnings (esp. when compiling in "debug" mode).
Then we can consider attributes...

Also available in: Atom PDF