All of lore.kernel.org
 help / color / mirror / Atom feed
* Unint var with GCC 4.5.2
@ 2011-05-06  9:41 Aygon, Bertrand
  2011-05-06  2:25 ` Denis Kenzior
  2011-05-06 18:59 ` Andrzej Zaborowski
  0 siblings, 2 replies; 7+ messages in thread
From: Aygon, Bertrand @ 2011-05-06  9:41 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 8240 bytes --]

Hi,

I have switched my dev environment to Ubuntu 11.04, and so I am using GCC 4.5.2.

Building oFono returns 2 erros due to uninit var. One is a false negative, so I have fix it with the 'magic define', and will send the patch soon (VPN is dead so I cannot send it).
But for the second one, I am not sure it's a false negative, so I would like to have the thought of the mailing list, and even better the author or guys who has some knowledge on this part of the code.

Here it's:

939<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l939> static void sim_get_image(struct ofono_sim *sim, unsigned char id,
940<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l940>                                 gpointer user_data)
941<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l941> {
942<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l942>         unsigned char *efimg;
943<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l943>         char *image;
944<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l944>         unsigned short iidf_id;
945<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l945>         unsigned short iidf_offset;
946<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l946>         unsigned short iidf_len;
947<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l947>
948<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l948>         image = sim_fs_get_cached_image(sim->simfs, id);
949<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l949>
950<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l950>         if (image != NULL) {
951<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l951>                 sim_get_image_cb(sim, id, image, FALSE);
952<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l952>                 goto watch;
953<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l953>         }
954<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l954>
955<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l955>         if (sim->efimg_length <= (id * 9)) {
956<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l956>                 sim_get_image_cb(sim, id, NULL, FALSE);
957<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l957>                 return;
958<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l958>         }
959<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l959>
960<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l960>         efimg = &sim->efimg[id * 9];
961<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l961>
962<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l962>         iidf_id = efimg[3] << 8 | efimg[4];
963<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l963>         iidf_offset = efimg[5] << 8 | efimg[6];
964<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l964>         iidf_len = efimg[7] << 8 | efimg[8];
965<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l965>
966<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l966>         /* read the image data */
967<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l967>         ofono_sim_read_bytes(sim->context, iidf_id, iidf_offset, iidf_len,
968<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l968>                                 sim_iidf_read_cb, sim);
969<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l969>
970<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l970> watch:
971<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l971>         if (sim->efimg_length <= id * 9)
972<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l972>                 return;
973<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l973>
974<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l974>         if (sim->iidf_watch_ids[id] > 0)
975<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l975>                 return;
976<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l976>
977<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l977>         sim->iidf_watch_ids[id] = ofono_sim_add_file_watch(sim->context,
978<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l978>                                         iidf_id, sim_image_data_changed,
979<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l979>                                         sim, NULL);
980<http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=src/sim.c;h=af7a715a1609769cd2e1d85e865cb6e02823d7bb;hb=HEAD#l980> }

The unint var is 'unsigned short iidf_id;'

If the image is in the cache, we will go to the watch directly, and if there is no watch, we will add one with an invalid iidf_id.

So is it possible to have an image in the cache without watch?

Thanks,

Bertrand

--
Bertrand Aygon                      Engineering Manager
Bertrand.Aygon(a)Intel.com<mailto:Bertrand.Aygon@intel.com>            Open Source Technology Center, Intel Corporation

---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 15824 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-05-09  9:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-06  9:41 Unint var with GCC 4.5.2 Aygon, Bertrand
2011-05-06  2:25 ` Denis Kenzior
2011-05-06 14:09   ` Aygon, Bertrand
2011-05-06  2:52     ` Denis Kenzior
2011-05-06 18:59 ` Andrzej Zaborowski
2011-05-09  4:28   ` Denis Kenzior
2011-05-09  9:51   ` Aygon, Bertrand

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.