<div dir="ltr">Thank you for the tips, Teemu, and Erik,<div><br></div><div>gmx_unused is what I was looking for to subclass a Gromacs abstract class with fewer requirements. I had trouble simply commenting out the unused parameters for pure virtual methods, but I am also curious why the the &#39;unused&#39; attribute macros are not the preferred approach or even marking them void in the definition?</div><div><br></div><div>I used commit b57307c233 from the &#39;gromacs&#39; branch of uncrustify from git://<a href="http://github.com/rolandschulz/uncrustify.git">github.com/rolandschulz/uncrustify.git</a> but constructor member initialization lists still seemed to get confused by brace initialization, at least for certain argument types. I didn&#39;t require brace initialization so I switched to traditional syntax, but I wonder whether there is an option I was missing or if this is just a matter of limited logic in uncrustify.</div><div><br></div><div>Cheers,</div><div>Eric</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Apr 1, 2017 at 12:39 AM, Teemu Murtola <span dir="ltr">&lt;<a href="mailto:teemu.murtola@gmail.com" target="_blank">teemu.murtola@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span class="">On Sat, Apr 1, 2017 at 1:56 AM Erik Lindahl &lt;<a href="mailto:erik.lindahl@gmail.com" target="_blank">erik.lindahl@gmail.com</a>&gt; wrote:<br></span><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="m_-4333756703283836014gmail_msg"><div class="gmail_extra m_-4333756703283836014gmail_msg"><div class="gmail_quote m_-4333756703283836014gmail_msg"><span class="">On Sat, Apr 1, 2017 at 12:31 AM, Eric Irrgang <span dir="ltr" class="m_-4333756703283836014gmail_msg">&lt;<a href="mailto:ericirrgang@gmail.com" class="m_-4333756703283836014gmail_msg" target="_blank">ericirrgang@gmail.com</a>&gt;</span> wrote:</span><span class=""><blockquote class="gmail_quote m_-4333756703283836014gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="m_-4333756703283836014gmail_msg"><div class="m_-4333756703283836014gmail_msg"><div class="m_-4333756703283836014gmail_msg"> * Is there a Gromacs convention for dealing with unused<br></div></div></div></blockquote></span></div></div></div><span class=""><div dir="ltr" class="m_-4333756703283836014gmail_msg"><div class="gmail_extra m_-4333756703283836014gmail_msg"><div class="gmail_quote m_-4333756703283836014gmail_msg"><blockquote class="gmail_quote m_-4333756703283836014gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="m_-4333756703283836014gmail_msg"><div class="m_-4333756703283836014gmail_msg"><div class="m_-4333756703283836014gmail_msg">   parameters in polymorphic methods to avoid compiler warnings</div><div class="m_-4333756703283836014gmail_msg">   and potential waste?</div></div></div></blockquote><div class="m_-4333756703283836014gmail_msg"><br class="m_-4333756703283836014gmail_msg"></div></div></div></div><div dir="ltr" class="m_-4333756703283836014gmail_msg"><div class="gmail_extra m_-4333756703283836014gmail_msg"><div class="gmail_quote m_-4333756703283836014gmail_msg"><div class="m_-4333756703283836014gmail_msg">&quot;gmx_unused&quot; is available, but don&#39;t go overboard with it. If you start to need it for more than a single parameters the method/class should probably be split into something simpler instead.</div></div></div></div></span></blockquote><div><br></div><div>On this particular topic, I would rather use the following approaches in new code (in a decreasing order of preference):</div><div><ul><li>Comment out the parameter name in the method declaration (if it is never used). This makes it very clear that the parameter is not used, since the compiler enforces it.</li><li>Use GMX_UNUSED_VALUE() if you need the parameter name for Doxygen (probably rare for polymorphic methods, since the base interface should document them), or if the parameter is unused only on some conditional compilation paths; the macro can make this explicit.<br></li><li>Use gmx_unused if nothing else works.</li></ul><div>Best regards,</div></div><div>Teemu</div></div></div>
<br>--<br>
Gromacs Developers mailing list<br>
<br>
* Please search the archive at <a href="http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List" rel="noreferrer" target="_blank">http://www.gromacs.org/<wbr>Support/Mailing_Lists/GMX-<wbr>developers_List</a> before posting!<br>
<br>
* Can&#39;t post? Read <a href="http://www.gromacs.org/Support/Mailing_Lists" rel="noreferrer" target="_blank">http://www.gromacs.org/<wbr>Support/Mailing_Lists</a><br>
<br>
* For (un)subscribe requests visit<br>
<a href="https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers" rel="noreferrer" target="_blank">https://maillist.sys.kth.se/<wbr>mailman/listinfo/gromacs.org_<wbr>gmx-developers</a> or send a mail to <a href="mailto:gmx-developers-request@gromacs.org">gmx-developers-request@<wbr>gromacs.org</a>.<br></blockquote></div><br></div>