-----Original Message----- > Date: Mon, 24 Sep 2018 10:30:30 +0200 > From: Andrzej Ostruszka <a...@semihalf.com> > To: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v3 3/4] app/test-eventdev: add Tx adapter > support > User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 > Thunderbird/52.9.1 > > > On 23.09.2018 13:35, Jerin Jacob wrote: > > -----Original Message----- > >> Date: Thu, 20 Sep 2018 03:52:34 +0530 > >> From: Pavan Nikhilesh <pbhagavat...@caviumnetworks.com> > [...] > >> - struct rte_event_dev_info info; > >> - struct test_pipeline *t = evt_test_priv(test); > >> - uint8_t tx_evqueue_id = 0; > >> + uint8_t tx_evqueue_id[RTE_MAX_ETHPORTS] = {0}; > > > > Some old compiler throws error with this scheme. Please change to memset. > > Really? Could you give an example? > > That is perfectly legal C (since "forever"?) and I find it more readable > than memset. Don't treat it as a request to keep the original version - > if I were Pavan I would object this particular request since I prefer > direct initialization, however here I'm more interested in learning more > about your statement about compilers not supporting zero initialization > of array members after the last initializer. And maybe also about to > what extent we should be supporting old/non compliant compilers (the doc > suggest to use gcc 4.9+).
Clang don't like this kind of zero-initialization depending on which type of parameter comes first in the structure. An array of uint8_t should be OK. I thought of keeping safe here as it was going for next revision. Unofficially, people used to test with old compiler such as gcc 4.7 etc. http://patches.dpdk.org/patch/40750/ // Search clang here. http://patches.dpdk.org/patch/38189/ > > Best regards > Andrzej