Ticket #2349 (closed: fixed)

Opened 10 years ago

Last modified 5 years ago

Create some kind of UNUSED_ARG macro

Reported by: Martyn Gigg Owned by: Martyn Gigg
Priority: trivial Milestone: Iteration 28
Component: Mantid Keywords:
Cc: Blocked By:
Blocking: Tester: Michael Whitty

Description (last modified by Martyn Gigg) (diff)

The Qt source code defines a macro, Q_UNUSED, for those arguments that are unused in a function but are needed for documentation purposes.

We are starting to get many cases of (void)arg everywhere and it would be good to have something similar ourselves for consistency.

It's definition would be simple

#define UNUSED_ARG(x) (void)x;

The hard (or rather dull) part would be putting these everywhere that is necessary. This would help reduce our compiler warnings as well

Change History

comment:1 Changed 10 years ago by Martyn Gigg

  • Description modified (diff)

comment:2 Changed 10 years ago by Nick Draper

  • Milestone changed from Iteration 27 to Iteration 28

Bulk move of tickets at the end of iteration 27

comment:3 Changed 9 years ago by Nick Draper

  • Owner set to Peter Peterson
  • Status changed from new to assigned

comment:4 Changed 9 years ago by Martyn Gigg

  • Owner changed from Peter Peterson to Martyn Gigg

This will be useful for warnings day and since we'll start in the UK I'll put this one in for people to use.

comment:5 Changed 9 years ago by Martyn Gigg

  • Status changed from assigned to verify
  • Resolution set to fixed

(In [10934]) Fixes #2349. Add a macro that can be used to stop compiler warnings for unused function arguments. Saves every person from doing (void)x Silence warning. The macro name, UNUSED_ARG, should make it obvious what is happening. Kernel instances have been updated to use it.

comment:6 Changed 9 years ago by Michael Whitty

  • Status changed from verify to verifying
  • Tester set to Michael Whitty

comment:7 Changed 9 years ago by Michael Whitty

  • Status changed from verifying to closed

this is done

comment:8 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 3196

Note: See TracTickets for help on using tickets.