json: Fix compile error on RHEL6
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Tue, 21 Apr 2020 19:17:12 +0000 (04:17 +0900)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Tue, 21 Apr 2020 19:50:18 +0000 (04:50 +0900)
commit60b49c7cfdb3b92c94fd927d6a72a0f6abd9a8ec
tree27419e54f2fa4fb5f7af952c64e6eb2611473ad6
parent173ff874d01466fa19f41998225d173cafd7e3bc
json: Fix compile error on RHEL6

eb2f29b7fd("Make the JSON code easier to analyze") doesn't compile
on RHEL6 using gcc4.x.

Using "{.object = val,}," for an union field seems to fix the issue,
but just use "arg.object = val;" instead as this is guaranteed to
compile on supported platforms.

--
    CC gettime.o
In file included from stat.h:7,
                 from thread_options.h:7,
                 from fio.h:18,
                 from gettime.c:7:
json.h: In function 'json_object_add_value_object':
json.h:95: error: unknown field 'object' specified in initializer
json.h:95: warning: missing braces around initializer
json.h:95: warning: (near initialization for 'arg.<anonymous>')
json.h:95: warning: initialization makes integer from pointer without a cast
make: *** [gettime.o] Error 1

Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
json.h