View Issue Details

IDProjectCategoryView StatusLast Update
0006743GNUnetfile-sharing servicepublic2022-02-26 23:10
Reportercy1 Assigned Toschanzen  
PrioritylowSeverityfeatureReproducibilityhave not tried
Status closedResolutionfixed 
PlatformGentooOSLinuxOS Version5.9.1
Product VersionGit master 
Fixed in Version0.16.0 
Summary0006743: anonymous structs in GNUNET_FS_ProgressInfo impede modularity
DescriptionI'd like to write myself a dispatcher that delegates to various dispatchers in different modules for each operation, like:

```
static void* progress_cb (void *cls,
                          const struct GNUNET_FS_ProgressInfo *info) {
    switch(info->status) {
    case GNUNET_FS_STATUS_SEARCH_RESULT:
              return search_progress(info->value.search);
        case GNUNET_FS_DOWNLOAD_PROGRESS:
              return download_progress(info->value.download);
        ...
        };
}
```

But since info->value.search is an anonymous struct, there is no way to write the function signature for search_progress, or download_progress, outside of using typeof like:

```
const struct GNUNET_FS_ProgressInfo dummyvariable __attribute__((__unused__));
void* search_progress(const typeof(dummyvariable.value.search) info);
```

I would appreciate it if each of the members of that union could be given names, however ludicrously verbose, so that I could write:

```
void* search_progress(GNUNET_FS_ProgressInfoSearch info);
```

Once I know it's a search event, there's no reason to access value.download or value.publish, so it just prevents me from removing verbosity, and introduces potential for interface boundary failures such as accidentally using code which accesses value.download in a search dispatcher. Anyway it's just a little nitpick I wanted to get reported so that someone with commit access could patch it whenever they get around to it.
TagsNo tags attached.
Attached Files

Activities

schanzen

2021-02-21 10:55

administrator   ~0017558

Can you check 8095b1a1b..a3971a93c if that is what you need?

schanzen

2022-02-22 23:12

administrator   ~0018712

Closing as reporter unresponsive and this is presumably fixed.

schanzen

2022-02-26 23:10

administrator   ~0018723

0.16.0 released

Issue History

Date Modified Username Field Change
2021-02-06 18:11 cy1 New Issue
2021-02-06 18:11 cy1 File Added: named_progress_values.bundle
2021-02-21 10:55 schanzen Assigned To => schanzen
2021-02-21 10:55 schanzen Status new => feedback
2021-02-21 10:55 schanzen Note Added: 0017558
2021-02-21 10:55 schanzen Target Version => 0.14.1
2021-04-05 11:25 schanzen Target Version 0.14.1 => 0.14.2
2021-06-10 19:37 schanzen Target Version 0.14.2 => 0.15.0
2021-06-10 23:01 schanzen Target Version 0.15.0 =>
2022-02-22 23:12 schanzen Status feedback => resolved
2022-02-22 23:12 schanzen Resolution open => fixed
2022-02-22 23:12 schanzen Fixed in Version => 0.16.0
2022-02-22 23:12 schanzen Note Added: 0018712
2022-02-26 23:10 schanzen Note Added: 0018723
2022-02-26 23:10 schanzen Status resolved => closed