[SSSD] [PATCH][ding_libs] INI: Include missing header files

Lukas Slebodnik lslebodn at redhat.com
Fri Jan 17 15:30:57 UTC 2014


On (13/01/14 10:39), Dmitri Pal wrote:
>On 01/13/2014 09:54 AM, Lukas Slebodnik wrote:
>> On (13/01/14 09:07), Dmitri Pal wrote:
>>> On 01/13/2014 05:49 AM, Lukas Slebodnik wrote:
>>>> ehlo,
>>>>
>>>> Function ini_config_serialize was declared in the header file ini_configobj.h,
>>>> but this header file was not included in implementation module ini_serialize.c
>>> This is fine though I do not see a big reason to do this.
>>>
>>>> Functions print_config_parsing_errors, print_file_parsing_errors were declared
>>>> in the header file ini_config.h, but this header file was not included
>>>> in  implementation module ini_print.c
>>> ini_config.h is the old interface
>>> ini_configobj.h is the new interface
>> Yes,
>> but problem is that implementations of functions from old interface are in the
>> same module (ini_print.c) like implementations of functions from old interface.
>> If you do not like including both header files in one module, we should file a
>> ticket to split file ini_print.c. It is internal change and I hope easy task.
>>
>> But without this patch there will be some warnings:
>>   CC       ini_print.lo
>> ini/ini_print.c:327:6: warning: no previous prototype for 'print_file_parsing_errors' [-Wmissing-prototypes]
>>  void print_file_parsing_errors(FILE *file,
>>       ^
>> ini/ini_print.c:405:6: warning: no previous prototype for 'print_config_parsing_errors' [-Wmissing-prototypes]
>>  void print_config_parsing_errors(FILE *file,
>>       ^
>
>I took a look at these two functions. They are not used in the new
>interface.
>I suggest we just explicitly add declarations for these two functions to
>the top of ini_print.c instead of including the header file.
Done

>Splitting the module is a more labor intensive change. I would rather
>wait some time and just remove the old interface.
>Then split would not be needed.
>
>>> These headers should not be included into one module.
>>> They are mutually exclusive.
>>>
>>> Functions should probably be included into ini_configobj.h but I have
>>> not included them because they are already declared in the old interface.
>>> So may be we should move them from old to new rather than declare them
>>> twice?
>>>

New file is attached.

LS
-------------- next part --------------
>From 67f7ebea952af2cce671ae338a09d2f13677ff40 Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn at redhat.com>
Date: Sat, 11 Jan 2014 14:29:53 +0100
Subject: [PATCH] INI: Include missing header file with declarations

Function ini_config_serialize was declared in the header file ini_configobj.h,
but this header file was not included in implementation module ini_serialize.c

Functions print_config_parsing_errors, print_file_parsing_errors were declared
in the header file ini_config.h, but this header file was not included
in  implementation module ini_print.c
---
 ini/ini_print.c     | 12 ++++++++++++
 ini/ini_serialize.c |  1 +
 2 files changed, 13 insertions(+)

diff --git a/ini/ini_print.c b/ini/ini_print.c
index ad102361186e5c122b0c01c1b5335139e56f9e73..0da9d626d3ed92232384d8f7f17e4dde7f51d72b 100644
--- a/ini/ini_print.c
+++ b/ini/ini_print.c
@@ -32,6 +32,18 @@
 #include "ini_config_priv.h"
 #include "ini_configobj.h"
 
+/* Following declarations are from header file ini_config.h. This file was not
+ * included, because we don't want on include header file
+ * with old interface(ini_config.h) and new interface(ini_configobj.h)
+ * into the one file.
+ */
+void print_config_parsing_errors(FILE *file,
+                                         struct collection_item *error_set);
+
+
+void print_file_parsing_errors(FILE *file,
+                                       struct collection_item *error_list);
+
 
 /*============================================================*/
 /* The following classes moved here from the public header
diff --git a/ini/ini_serialize.c b/ini/ini_serialize.c
index dcda5acc32973c261391bdb59935c6c5aa35efc6..d0399029a526802fd04e43c5777e562e01360708 100644
--- a/ini/ini_serialize.c
+++ b/ini/ini_serialize.c
@@ -28,6 +28,7 @@
 #include "collection.h"
 #include "ini_valueobj.h"
 #include "ini_defines.h"
+#include "ini_configobj.h"
 #include "ini_config_priv.h"
 #include "trace.h"
 
-- 
1.8.4.2



More information about the sssd-devel mailing list