<div dir="ltr">On the related node I think this patch introduces some compilation warnings. <div><br></div><div>See below the warnings when I compile the code on CentOS 7</div><div><br></div><div><div><font face="monospace, monospace">main/pgpool_main.c: In function ‘register_node_operation_request’:</font></div><div><font face="monospace, monospace">main/pgpool_main.c:496:3: warning: passing argument 1 of ‘memcpy’ discards ‘volatile’ qualifier from pointer target type [enabled by default]</font></div><div><font face="monospace, monospace">   memcpy(Req_info-&gt;request[index].node_id, node_id_set, (sizeof(int) * count));</font></div><div><font face="monospace, monospace">   ^</font></div><div><font face="monospace, monospace">In file included from /usr/include/sys/un.h:37:0,</font></div><div><font face="monospace, monospace">                 from main/pgpool_main.c:26:</font></div><div><font face="monospace, monospace">/usr/include/string.h:42:14: note: expected ‘void * __restrict__’ but argument is of type ‘volatile int *’</font></div><div><font face="monospace, monospace"> extern void *memcpy (void *__restrict __dest, const void *__restrict __src,</font></div><div><font face="monospace, monospace">              ^</font></div><div><font face="monospace, monospace">main/pgpool_main.c: In function ‘failover’:</font></div><div><font face="monospace, monospace">main/pgpool_main.c:1536:3: warning: passing argument 2 of ‘memcpy’ discards ‘volatile’ qualifier from pointer target type [enabled by default]</font></div><div><font face="monospace, monospace">   memcpy(node_id_set, Req_info-&gt;request[queue_index].node_id , (sizeof(int) * Req_info-&gt;request[queue_index].count));</font></div><div><font face="monospace, monospace">   ^</font></div><div><font face="monospace, monospace">In file included from /usr/include/sys/un.h:37:0,</font></div><div><font face="monospace, monospace">                 from main/pgpool_main.c:26:</font></div><div><font face="monospace, monospace">/usr/include/string.h:42:14: note: expected ‘const void * __restrict__’ but argument is of type ‘volatile int *’</font></div><div><font face="monospace, monospace"> extern void *memcpy (void *__restrict __dest, const void *__restrict __src,</font></div><div><font face="monospace, monospace"> </font></div></div><div>Thanks</div><div>Best Regards</div><div>Muhammad Usama</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 18, 2017 at 5:49 PM, Muhammad Usama <span dir="ltr">&lt;<a href="mailto:m.usama@gmail.com" target="_blank">m.usama@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"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Tue, May 16, 2017 at 4:55 PM, Tatsuo Ishii <span dir="ltr">&lt;<a href="mailto:ishii@sraoss.co.jp" target="_blank">ishii@sraoss.co.jp</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Usama,<br>
<br>
Watchdog uses shared memory and I wonder if some of pointer variables<br>
to the shared memory are may need &quot;volatile&quot; to make sure that they<br>
fetch the fresh value. What do you think?<br></blockquote><div><br></div></span><i>ipc_shared_key</i> and <i>watchdog_ipc_address</i> are only set once at the startup time and never changed So I don&#39;t think we need to make it volatile.<br>But I think we may need watchdog_require_cleanup and watchdog_node_escalated to be declared as volatile.<br><div><font color="#000000" face="menlo"><span style="font-size:11px"> </span></font> </div><div>Regards</div><span class="HOEnZb"><font color="#888888"><div>Muhammad Usama</div></font></span><div><div class="h5"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<br>
/* shared memory variables */<br>
char *watchdog_ipc_address = NULL;<br>
bool *watchdog_require_cleanup = NULL;  /* shared memory variable set to true<br>
                                                                                 * when watchdog process terminates abnormally<br>
                                                                                 */<br>
bool *watchdog_node_escalated = NULL;   /* shared memory variable set to true<br>
                                                                                 * when watchdog process has performed escalation<br>
                                                                                 */<br>
unsigned int *ipc_shared_key = NULL;   /* key lives in shared memory<br>
                                                                                * used to identify the ipc internal<br>
                                                                                * clients<br>
                                                                                */ </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<div><div class="m_-4133098238797946655gmail-h5">&gt; Use volatile pointer for Req_info variable.<br>
&gt;<br>
&gt; Since Req_info points to shared memory area, using volatile pointer<br>
&gt; will allow to fetch the fresh value.<br>
&gt;<br>
&gt; Branch<br>
&gt; ------<br>
&gt; master<br>
&gt;<br>
&gt; Details<br>
&gt; -------<br>
&gt; <a href="https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=a4de4bfc1421d787b53789eb62eb7e9cb26e91c1" rel="noreferrer" target="_blank">https://git.postgresql.org/git<wbr>web?p=pgpool2.git;a=commitdiff<wbr>;h=a4de4bfc1421d787b53789eb62e<wbr>b7e9cb26e91c1</a><br>
&gt;<br>
&gt; Modified Files<br>
&gt; --------------<br>
&gt; src/include/pool.h                                               | 2 +-<br>
&gt; src/main/pgpool_main.c                                           | 2 +-<br>
&gt; src/test/regression/tests/010.<wbr>rewrite_timestamp/timestamp/ma<wbr>in.c | 2 +-<br>
&gt; 3 files changed, 3 insertions(+), 3 deletions(-)<br>
&gt;<br>
</div></div>______________________________<wbr>_________________<br>
pgpool-hackers mailing list<br>
<a href="mailto:pgpool-hackers@pgpool.net" target="_blank">pgpool-hackers@pgpool.net</a><br>
<a href="http://www.pgpool.net/mailman/listinfo/pgpool-hackers" rel="noreferrer" target="_blank">http://www.pgpool.net/mailman/<wbr>listinfo/pgpool-hackers</a><br>
</blockquote></div></div></div><br></div></div>
</blockquote></div><br></div>