Skip to content

Commit 12a1c13

Browse files
committed
enabled and mitigated -Wdocumentation and -Wdocumentation-unknown-command Clang compiler warnings
1 parent da8fa05 commit 12a1c13

38 files changed

+73
-124
lines changed

common/list.h

-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ list_dump_items(struct list *self);
104104
*
105105
* @param str String to split.
106106
* @param character Character used as the delimiter between strings.
107-
* @param start_index Index to start on the source list (zero based)
108107
*
109108
* @result 0 if a memory allocation failure occurred.
110109
*

common/log.c

+2-9
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ internal_log_file_open(const char *fname)
8484
/**
8585
*
8686
* @brief Converts xrdp log level to syslog logging level
87-
* @param xrdp logging level
87+
* @param lvl logging level
8888
* @return syslog equivalent logging level
8989
*
9090
*/
@@ -114,7 +114,6 @@ internal_log_xrdp2syslog(const enum logLevels lvl)
114114
* @brief Converts xrdp log levels to textual logging levels
115115
* @param lvl logging level
116116
* @param str pointer to a string, must be allocated before
117-
* @return The log string in str pointer.
118117
*
119118
*/
120119
void
@@ -232,8 +231,6 @@ internal_log_end(struct log_config *l_cfg)
232231

233232
/**
234233
* Converts a string representing the log level to a value
235-
* @param buf
236-
* @return
237234
*/
238235
enum logLevels
239236
internal_log_text2level(const char *buf)
@@ -828,8 +825,7 @@ log_start_from_param(const struct log_config *src_log_config)
828825
/**
829826
* This function initialize the log facilities according to the configuration
830827
* file, that is described by the in parameter.
831-
* @param iniFile
832-
* @param applicationName, the name that is used in the log for the running application
828+
* @param applicationName the name that is used in the log for the running application
833829
* @return 0 on success
834830
*/
835831
enum logReturns
@@ -873,7 +869,6 @@ log_start(const char *iniFile, const char *applicationName,
873869

874870
/**
875871
* Function that terminates all logging
876-
* @return
877872
*/
878873
enum logReturns
879874
log_end(void)
@@ -1121,7 +1116,6 @@ internal_log_message(const enum logLevels lvl,
11211116

11221117
/**
11231118
* Return the configured log file name
1124-
* @return
11251119
*/
11261120
char *
11271121
getLogFile(char *replybuf, int bufsize)
@@ -1147,7 +1141,6 @@ getLogFile(char *replybuf, int bufsize)
11471141

11481142
/**
11491143
* Returns formatted datetime for log
1150-
* @return
11511144
*/
11521145
char *
11531146
getFormattedDateTime(char *replybuf, int bufsize)

common/log.h

+24-38
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,6 @@ struct log_config
224224
*
225225
* @brief Starts the logging subsystem
226226
* @param l_cfg logging system configuration
227-
* @return
228227
*
229228
*/
230229
enum logReturns
@@ -241,7 +240,7 @@ internal_log_end(struct log_config *l_cfg);
241240

242241
/**
243242
* Converts a log level to a string
244-
* @param lvl, the loglevel
243+
* @param lvl the loglevel
245244
* @param str pointer where the string will be stored.
246245
*/
247246
void
@@ -250,7 +249,7 @@ internal_log_lvl2str(const enum logLevels lvl, char *str);
250249
/**
251250
*
252251
* @brief Converts a string to a log level
253-
* @param s The string to convert
252+
* @param buf The string to convert
254253
* @return The corresponding level or LOG_LEVEL_DEBUG if error
255254
*
256255
*/
@@ -273,12 +272,11 @@ internal_log_config_dump(struct log_config *config);
273272

274273
/**
275274
* the log function that all files use to log an event.
276-
* @param lvl, the loglevel
277-
* @param override_destination_level, if true then the destination log level is not used
278-
* @param override_log_level, the loglevel instead of the destination log level if override_destination_level is true
279-
* @param msg, the logtext.
280-
* @param ap, the values for the message format arguments
281-
* @return
275+
* @param lvl the loglevel
276+
* @param override_destination_level if true then the destination log level is not used
277+
* @param override_log_level the loglevel instead of the destination log level if override_destination_level is true
278+
* @param msg the logtext.
279+
* @param ap the values for the message format arguments
282280
*/
283281
enum logReturns
284282
internal_log_message(const enum logLevels lvl,
@@ -288,9 +286,9 @@ internal_log_message(const enum logLevels lvl,
288286
va_list ap);
289287

290288
/**
291-
* @param log_level, the log level
292-
* @param override_destination_level, if true then the destination log level is ignored.
293-
* @param override_log_level, the log level to use instead of the destination log level
289+
* @param log_level the log level
290+
* @param override_destination_level if true then the destination log level is ignored.
291+
* @param override_log_level the log level to use instead of the destination log level
294292
* if override_destination_level is true
295293
* @return true if at least one log destination will accept a message logged at the given level.
296294
*/
@@ -300,9 +298,9 @@ internal_log_is_enabled_for_level(const enum logLevels log_level,
300298
const enum logLevels override_log_level);
301299

302300
/**
303-
* @param function_name, the function name (typically the __func__ macro)
304-
* @param file_name, the file name (typically the __FILE__ macro)
305-
* @param[out] log_level_return, the log level to use instead of the destination log level
301+
* @param function_name the function name (typically the __func__ macro)
302+
* @param file_name the file name (typically the __FILE__ macro)
303+
* @param[out] log_level_return the log level to use instead of the destination log level
306304
* @return true if the logger location overrides the destination log levels
307305
*/
308306
bool_t
@@ -316,7 +314,6 @@ internal_log_location_overrides_level(const char *function_name,
316314
/**
317315
* This function initialize the log facilities according to the configuration
318316
* file, that is described by the in parameter.
319-
* @param iniFile
320317
* @param applicationName the name that is used in the log for the running
321318
* application
322319
* @param flags Flags to affect the operation of the call
@@ -328,8 +325,6 @@ log_start(const char *iniFile, const char *applicationName,
328325

329326
/**
330327
* An alternative log_start where the caller gives the params directly.
331-
* @param config
332-
* @return
333328
*
334329
* @post to avoid memory leaks, the config argument must be free'ed using
335330
* `log_config_free()`
@@ -344,8 +339,8 @@ log_start_from_param(const struct log_config *src_log_config);
344339
* The config can be customised by the caller before calling
345340
* log_start_from_param()
346341
*
347-
* @param Default log level
348-
* @param Log level name, or NULL. This can be used to provide an
342+
* @param lvl log level
343+
* @param override_name level name, or NULL. This can be used to provide an
349344
* override to the default log level, by environment variable or
350345
* argument.
351346
*
@@ -357,10 +352,8 @@ log_config_init_for_console(enum logLevels lvl, const char *override_name);
357352
/**
358353
* Read configuration from a file and store the values in the returned
359354
* log_config.
360-
* @param file
361-
* @param applicationName, the application name used in the log events.
362-
* @param section_prefix, prefix for the logging sections to parse
363-
* @return
355+
* @param applicationName the application name used in the log events.
356+
* @param section_prefix prefix for the logging sections to parse
364357
*/
365358
struct log_config *
366359
log_config_init_from_config(const char *iniFilename,
@@ -375,7 +368,6 @@ log_config_free(struct log_config *config);
375368

376369
/**
377370
* Function that terminates all logging
378-
* @return
379371
*/
380372
enum logReturns
381373
log_end(void);
@@ -385,10 +377,8 @@ log_end(void);
385377
*
386378
* Please prefer to use the LOG and LOG_DEVEL macros instead of this function directly.
387379
*
388-
* @param lvl, the loglevel
389-
* @param msg, the logtext.
390-
* @param ...
391-
* @return
380+
* @param lvl the loglevel
381+
* @param msg the logtext.
392382
*/
393383
enum logReturns
394384
log_message(const enum logLevels lvl, const char *msg, ...) printflike(2, 3);
@@ -405,13 +395,11 @@ log_hexdump(const enum logLevels log_level,
405395
*
406396
* Please prefer to use the LOG and LOG_DEVEL macros instead of this function directly.
407397
*
408-
* @param function_name, the function name (typically the __func__ macro)
409-
* @param file_name, the file name (typically the __FILE__ macro)
410-
* @param line_number, the line number in the file (typically the __LINE__ macro)
411-
* @param lvl, the loglevel
412-
* @param msg, the logtext.
413-
* @param ...
414-
* @return
398+
* @param function_name the function name (typically the __func__ macro)
399+
* @param file_name the file name (typically the __FILE__ macro)
400+
* @param line_number the line number in the file (typically the __LINE__ macro)
401+
* @param lvl the loglevel
402+
* @param msg the logtext.
415403
*/
416404
enum logReturns
417405
log_message_with_location(const char *function_name,
@@ -434,13 +422,11 @@ log_hexdump_with_location(const char *function_name,
434422
* This function returns the configured file name for the logfile
435423
* @param replybuf the buffer where the reply is stored
436424
* @param bufsize how big is the reply buffer.
437-
* @return
438425
*/
439426
char *getLogFile(char *replybuf, int bufsize);
440427

441428
/**
442429
* Returns formatted datetime for log
443-
* @return
444430
*/
445431
char *getFormattedDateTime(char *replybuf, int bufsize);
446432

common/os_calls.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ int g_sck_select(int sck1, int sck2);
152152
* @param sck File descriptor for peer
153153
* @param ip buffer to write IP address to
154154
* @param bytes Size of ip buffer. Should be at least MAX_IP_ADDRSTRLEN
155-
* @param[out] portptr Optional variable to receive the port number
155+
* @param[out] port Optional variable to receive the port number
156156
* @return Pointer to IP for convenience
157157
*
158158
* If the peer has no IP address (for example, it is a Unix Domain Socket),
@@ -203,7 +203,7 @@ int g_delete_wait_obj(tintptr obj);
203203
* @param read_objs Array of read objects
204204
* @param rcount Number of elements in read_objs
205205
* @param write_objs Array of write objects
206-
* @param rcount Number of elements in write_objs
206+
* @param wcount Number of elements in write_objs
207207
* @param mstimeout Timeout in milliseconds. <= 0 means an infinite timeout.
208208
*
209209
* @return 0 for success. The objects will need to be polled to

common/string_calls.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ g_bytes_to_hexdump(const char *src, int len);
183183
/**
184184
* Extracts the display number from an X11 display string
185185
*
186-
* @param Display string (i.e. g_getenv("DISPLAY"))
186+
* @param display_text Display string (i.e. g_getenv("DISPLAY"))
187187
*
188188
* @result <0 if the string could not be parsed, or >=0 for a display number
189189
*/
@@ -261,7 +261,6 @@ g_bitmask_to_charstr(int bitmask, const struct bitmask_char bitdefs[],
261261
*
262262
* @param str Input string
263263
* @param bitdefs Array mapping tokens to bitmask values
264-
* @param delim Delimiter for tokens in str
265264
* @param[out] unrecognised Buffer for any unrecognised tokens
266265
* @param unrecognised_len Length of unrecognised including '\0';
267266
* @return bitmask value for recognised tokens

configure.ac

+1
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ AX_GCC_FUNC_ATTRIBUTE([format])
205205
AX_TYPE_SOCKLEN_T
206206
AX_CFLAGS_WARN_ALL
207207
AX_APPEND_COMPILE_FLAGS([-Wwrite-strings])
208+
AX_APPEND_COMPILE_FLAGS([-Wdocumentation -Wdocumentation-unknown-command], ,[-Werror])
208209

209210
AM_COND_IF([LINUX],
210211
[AX_APPEND_COMPILE_FLAGS([-Werror])]) # bsd has warnings that have not been fixed yet

fontutils/dumpfv1.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ struct program_args
5757
* Parses the program args
5858
*
5959
* @param argc Passed to main
60-
* @param @argv Passed to main
60+
* @param argv Passed to main
6161
* @param pa program_pargs structure for resulting values
6262
* @return !=0 for success
6363
*/

libipm/libipm.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ libipm_msg_out_init(struct trans *trans, unsigned short msgno,
154154
*
155155
* @param trans libipm transport
156156
* @param format a description of any arguments to add to the buffer.
157-
* @param != 0 if an error occurs
157+
* @return != 0 if an error occurs
158158
*
159159
* The format string is followed immediately by the arguments it
160160
* describes. The format string may contain these characters (from the
@@ -299,7 +299,7 @@ libipm_msg_in_peek_type(struct trans *trans);
299299
*
300300
* @param trans libipm transport
301301
* @param format a description of the arguments to read from the buffer.
302-
* @param != 0 if an error occurs
302+
* @return != 0 if an error occurs
303303
*
304304
* The format string is followed immediately by the arguments it
305305
* describes. The format string may contain these characters (from the

libipm/libipm_send.c

-1
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,6 @@ libipm_msg_out_appendv(struct trans *trans, const char *format, va_list *argptr)
471471
* Prepare the transport to build an output message
472472
* @param trans libipm trans
473473
* @param msgno Number of message
474-
* @return != 0 for error
475474
*/
476475
static void
477476
init_output_buffer(struct trans *trans, unsigned short msgno)

libipm/scp_application_types.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ struct scp_session_info
6565
enum scp_login_status
6666
{
6767
E_SCP_LOGIN_OK = 0, ///< The connection is now loggned in
68-
E_SCP_LOGIN_ALREADY_LOGGED_IN, //< A user is currently logged in
68+
E_SCP_LOGIN_ALREADY_LOGGED_IN, ///< A user is currently logged in
6969
E_SCP_LOGIN_NO_MEMORY, ///< Memory allocation failure
7070
/**
7171
* User couldn't be authenticated, or user doesn't exist */

libxrdp/xrdp_iso.c

-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,6 @@ xrdp_iso_process_rdp_neg_req(struct xrdp_iso *self, struct stream *s)
258258
* On exit, the TPKT header and the fixed part of the PDU header will have been
259259
* removed from the stream.
260260
*
261-
* @param self
262261
* @param s [in]
263262
* @param code [out]
264263
* @param len [out]

libxrdp/xrdp_mcs.c

-2
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,6 @@ xrdp_mcs_recv(struct xrdp_mcs *self, struct stream *s, int *chan)
253253
* Parse the identifier and length of a [ITU-T X.690] BER (Basic Encoding Rules)
254254
* structure header.
255255
*
256-
* @param self
257256
* @param s [in] - the stream to read from
258257
* @param tag_val [in] - the expected tag value
259258
* @param len [out] - the length of the structure
@@ -1488,7 +1487,6 @@ xrdp_mcs_send(struct xrdp_mcs *self, struct stream *s, int chan)
14881487

14891488
/**
14901489
* Internal help function to close the socket
1491-
* @param self
14921490
*/
14931491
void
14941492
close_rdp_socket(struct xrdp_mcs *self)

libxrdp/xrdp_rdp.c

-1
Original file line numberDiff line numberDiff line change
@@ -1590,7 +1590,6 @@ xrdp_rdp_send_deactivate(struct xrdp_rdp *self)
15901590
/*****************************************************************************/
15911591
/** Send a [MS-RDPBCGR] TS_SAVE_SESSION_INFO_PDU_DATA message.
15921592
*
1593-
* @param self
15941593
* @param data the data to send to the client in the
15951594
* TS_SAVE_SESSION_INFO_PDU_DATA message. The first 4 bytes of the data
15961595
* buffer MUST by the infoType value as specified in MS-RDPBCGR 2.2.10.1.1

sesman/chansrv/chansrv_config.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ log_to_stdout(const enum logLevels lvl, const char *msg, ...)
7777
*
7878
* @param logmsg Function to use to log messages
7979
* @param names List of definitions in the section
80-
* @params values List of corresponding values for the names
81-
* @params cfg Pointer to structure we're filling in
80+
* @param values List of corresponding values for the names
81+
* @param cfg Pointer to structure we're filling in
8282
*
8383
* @return 0 for success
8484
*/
@@ -130,8 +130,8 @@ read_config_security(log_func_t logmsg,
130130
*
131131
* @param logmsg Function to use to log messages
132132
* @param names List of definitions in the section
133-
* @params values List of corresponding values for the names
134-
* @params cfg Pointer to structure we're filling in
133+
* @param values List of corresponding values for the names
134+
* @param cfg Pointer to structure we're filling in
135135
*
136136
* @return 0 for success
137137
*/

sesman/chansrv/chansrv_config.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ config_read(int use_logger, const char *sesman_ini);
6565
/**
6666
*
6767
* @brief Dumps configuration to stdout
68-
* @param pointer to a config_chansrv struct
68+
* @param config pointer to a config_chansrv struct
6969
*
7070
*/
7171
void
@@ -74,7 +74,7 @@ config_dump(struct config_chansrv *config);
7474
/**
7575
*
7676
* @brief Frees configuration allocated by config_read()
77-
* @param pointer to a config_chansrv struct (may be NULL)
77+
* @param cs pointer to a config_chansrv struct (may be NULL)
7878
*
7979
*/
8080
void

0 commit comments

Comments
 (0)