Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37882233
en ru br
Репозитории ALT
5.1: 4.64L-alt6
4.1: 4.64L-alt5
4.0: 4.64L-alt4.1
3.0: 4.58L-alt4
+backports:4.64L-alt0.M30.4
www.altlinux.org/Changes

Группа :: Сети/Почта
Пакет: pine

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: warnings.patch
Скачать


# Warning-only fixes which may (depending on the compiler) not need to be
# applied but make the compilers more silent:
# Changes:
# 2005-2-20: Add inline comments as documentaiton
--- pico/osdep/unix
+++ pico/osdep/unix
@@ -2236,7 +2236,7 @@
 #ifdef	SIGCHLD
 	(void) signal(SIGCHLD,  SIG_DFL);
 #endif
-	if(execl("/bin/sh", "sh", "-c", eb, 0) < 0)
+	if(execl("/bin/sh", "sh", "-c", eb,(void*)0) < 0)
 	  exit(-1);
     }
     else {				/* error! */
--- pine/init.c
+++ pine/init.c
@@ -9284,7 +9284,24 @@
      */
     if(!err && !add_only_first_msg){
 	char *tempfile = NULL;
-	int   fd;
+	int   fd = 0;
+ /*
+  * Description for this initialisation:
+  * fd is is file descriptor, which is initialized in the line
+  * 
+  *   if(!err &&
+  *            (fd = open(tempfile, O_TRUNC|O_WRONLY|O_CREAT, 0600)) < 0){
+  *               q_status_message2(SM_ORDER | SM_DING, 3, 5,
+  *                               "Error opening temporary fi..."
+  * 
+  * the condition "!err" is superflous in this case, since it is checked at
+  * the entrance of this group and never changed, so fd gets assigned, which
+  * means it is initialized, and the code says that unless there is an error,
+  * the files gets closed.
+  * 
+  * So this analysis seems to say that the code works fine even without the
+  * initialisation here, but it makes gcc silent at this place.
+  */
 
 	if(rd->flags & NO_FILE){
 	    if(so_truncate(rd->sonofile, 0L) == 0)
--- pine/rules.c
+++ pine/rules.c
@@ -551,7 +551,21 @@
  int  rule_context;
  ENVELOPE *env;
 {
-    int rv;
+    int rv = 0;
+ /*
+  * This is code from Eduardo Chappa, he knows it very well and checked rv
+  * above to be ok even without the initialisation: This does not need
+  * initialization, because rv gets assigned in the code. The conditions in
+  * the for loop that contain rv is always satisfied in the first time the
+  * loop is run, that "condition" is not null, that is because any rule has a
+  * condition and an action, you can not have any of these null, otherwise the
+  * code nullifies the rule, which is the condition checked before we enter
+  * into that loop, and in the case the rule is null, the code is not
+  * executed, so there is no reason to touch rv in that case either.
+  *
+  * So this analysis seems to say that the code works fine even without the
+  * initialisation here, but it makes gcc silent at this place.
+  */
     char *result = NULL;
     CONDITION_S *condition;
 
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin