Opened 9 years ago

Last modified 2 years ago

#3283 new feature request

Selective disabling of unused bind warnings

Reported by: ajd Owned by:
Priority: normal Milestone:
Component: Compiler Version: 6.10.2
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Incorrect warning at compile-time Test Case:
Blocked By: Blocking:
Related Tickets: #17 Differential Rev(s):
Wiki Page:


I like to compile with -fwarn-unused-binds to keep my code clean, but I think a couple of extra flags to control this would be useful:

  • -fno-warn-unused-fields which would turn off warnings for record field names that were not used. I know you can prefix them with _, but then when you do use them then you have to change the name, etc.
  • A {-# USED f, g, h, ... #-} pragma to tell the compiler not to warn about the functions given in the pragma.

I can see how especially the second could be controversial as it introduces an incompatibility, but I think both of these features could be put to good use. Not very high priority, though.

Change History (7)

comment:1 Changed 9 years ago by igloo

difficulty: Unknown
Milestone: 6.12.1

comment:2 Changed 8 years ago by igloo

Milestone: 6.12.1_|_
Type of failure: None/Unknown

comment:3 Changed 4 years ago by nomeata

This might be a nice beginners tickets, but is it useful to people? No comment here for a long time... It seems to be related to #17.

comment:4 Changed 3 years ago by thomie

Keywords: newcomer added

Adding newcomer keyword at nomeata's suggestion.

comment:5 in reply to:  3 ; Changed 3 years ago by jstolarek

Replying to nomeata:

It seems to be related to #17.

I just came across this one and thought the same thing. Now that #17 is closed can we consider this a duplicate? I know this ticket proposes a separate pragma to mark definitions as used but with new warning flags added by #17 the pragma does not seem like a good idea.

comment:6 in reply to:  5 Changed 3 years ago by thomie

Keywords: newcomer removed

Replying to jstolarek:

Now that #17 is closed can we consider this a duplicate?

This ticket is about adding a -fno-warn-unused-fields flag.

But since nomeata wasn't sure how useful this feature would be, nobody has looked at it in 5 years, and #17 is indeed implemented, I'm at least removing the newcomer keyword.

comment:7 Changed 2 years ago by thomie

Type of failure: None/UnknownIncorrect warning at compile-time
Note: See TracTickets for help on using tickets.